diff --git a/source/sw/src/network.h b/source/sw/src/network.h index 141eb4fbb..84a75444e 100644 --- a/source/sw/src/network.h +++ b/source/sw/src/network.h @@ -52,27 +52,16 @@ BEGIN_SW_NS #define SYNC_TEST TRUE #define MAXSYNCBYTES 16 -#ifdef __GNUC__ -# define PACKED __attribute__ ((packed)) -#else -# define PACKED -# ifdef _MSC_VER -# pragma pack(1) -# endif -# ifdef __WATCOMC__ -# pragma pack(push,1); -# endif -#endif - +#pragma pack(push,1) // Slave->Master: PlayerIndex = who to send the packet to (-1 = all) // Master->Slave: PlayerIndex = who sent the packet originally -typedef struct PACKED +typedef struct { uint8_t PacketType; // first byte is always packet type uint8_t PlayerIndex; } PACKET_PROXY,*PACKET_PROXYp; -typedef struct PACKED +typedef struct { uint8_t PacketType; // first byte is always packet type uint8_t FirstPlayerIndex; @@ -89,7 +78,7 @@ typedef struct PACKED SWBOOL Nuke; } PACKET_NEW_GAME,*PACKET_NEW_GAMEp; -typedef struct PACKED +typedef struct { uint8_t PacketType; // first byte is always packet type SWBOOL AutoRun; @@ -97,31 +86,24 @@ typedef struct PACKED char PlayerName[32]; } PACKET_OPTIONS,*PACKET_OPTIONSp; -typedef struct PACKED +typedef struct { uint8_t PacketType; // first byte is always packet type char PlayerName[32]; } PACKET_NAME_CHANGE,*PACKET_NAME_CHANGEp; -typedef struct PACKED +typedef struct { uint8_t PacketType; // first byte is always packet type uint8_t RTSnum; } PACKET_RTS,*PACKET_RTSp; -typedef struct PACKED +typedef struct { uint8_t PacketType; // first byte is always packet type int Version; } PACKET_VERSION,*PACKET_VERSIONp; - -#undef PACKED -#ifdef _MSC_VER -# pragma pack() -#endif -#ifdef __WATCOMC__ -# pragma pack(pop); -#endif +#pragma pack(pop) extern uint8_t syncstat[MAXSYNCBYTES]; extern SWBOOL PredictionOn;