1 |
|
/* |
2 |
|
* ether_defs.h - Definitions for DLPI Ethernet Driver |
3 |
|
* |
4 |
< |
* SheepShaver (C) 1997-2004 Marc Hellwig and Christian Bauer |
4 |
> |
* SheepShaver (C) 1997-2005 Marc Hellwig and Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
22 |
|
#define ETHER_DEFS_H |
23 |
|
|
24 |
|
|
25 |
< |
#if __BEOS__ && __POWERPC__ |
25 |
> |
#if __MWERKS__ && __POWERPC__ |
26 |
|
#define PRAGMA_ALIGN_SUPPORTED 1 |
27 |
|
#define PACKED__ |
28 |
< |
#else |
28 |
> |
#elif defined __GNUC__ |
29 |
|
#define PACKED__ __attribute__ ((packed)) |
30 |
+ |
#elif defined __sgi |
31 |
+ |
#define PRAGMA_PACK_SUPPORTED 1 |
32 |
+ |
#define PACKED__ |
33 |
+ |
#else |
34 |
+ |
#error "Packed attribute or pragma shall be supported" |
35 |
|
#endif |
36 |
|
|
37 |
|
|
214 |
|
typedef uint8 nw_uint8; |
215 |
|
typedef uint16 nw_uint16; |
216 |
|
typedef uint32 nw_uint32; |
217 |
< |
typedef bool nw_bool; |
217 |
> |
typedef int nw_bool; |
218 |
|
typedef uint8 * nw_uint8_p; |
219 |
|
typedef void * nw_void_p; |
220 |
|
typedef datab * nw_datab_p; |
253 |
|
uint8 _pad[sizeof(type)]; |
254 |
|
public: |
255 |
|
operator public_type () const { |
256 |
< |
return (public_type)nw_memory_helper<sizeof(type)>::load((void *)this); |
256 |
> |
return (public_type)(uintptr)nw_memory_helper<sizeof(type)>::load((void *)this); |
257 |
|
} |
258 |
|
public_type operator -> () const { |
259 |
|
return this->operator public_type (); |
260 |
|
} |
261 |
|
nw_scalar_member_helper<type, public_type> & operator = (public_type val) { |
262 |
< |
nw_memory_helper<sizeof(type)>::store((void *)this, (type)val); |
262 |
> |
nw_memory_helper<sizeof(type)>::store((void *)this, (type)(uintptr)val); |
263 |
|
return *this; |
264 |
|
} |
265 |
|
nw_scalar_member_helper<type, public_type> & operator += (int val) { |
517 |
|
#pragma options align=mac68k |
518 |
|
#endif |
519 |
|
|
520 |
+ |
#ifdef PRAGMA_PACK_SUPPORTED |
521 |
+ |
#pragma pack(1) |
522 |
+ |
#endif |
523 |
+ |
|
524 |
|
// Packet headers |
525 |
|
struct EnetPacketHeader { |
526 |
|
uint8 fDestAddr[6]; |
552 |
|
uint8 fSNAP[k8022SNAPLength]; |
553 |
|
} PACKED__; |
554 |
|
|
555 |
+ |
#ifdef PRAGMA_PACK_SUPPORTED |
556 |
+ |
#pragma pack(0) |
557 |
+ |
#endif |
558 |
+ |
|
559 |
|
#ifdef PRAGMA_ALIGN_SUPPORTED |
560 |
|
#pragma options align=reset |
561 |
|
#endif |