diff --git a/sim_defs.h b/sim_defs.h index 2290a199..8c536357 100644 --- a/sim_defs.h +++ b/sim_defs.h @@ -315,6 +315,21 @@ typedef uint32 t_addr; #define SIM_NOINLINE #endif +/* Packed structure support */ + +#ifdef _MSC_VER +# define PACKED_BEGIN __pragma( pack(push, 1) ) +# define PACKED_END __pragma( pack(pop) ) +#else +# define PACKED_BEGIN +#if defined(_WIN32) +# define PACKED_END __attribute__((gcc_struct, packed)) +#else +# define PACKED_END __attribute__((packed)) +#endif +#endif + + /* Storage class modifier for weak link definition for sim_vm_init() */ #if defined(__cplusplus) diff --git a/slirp/ip.h b/slirp/ip.h index a4768a5c..0edcd361 100644 --- a/slirp/ip.h +++ b/slirp/ip.h @@ -62,15 +62,12 @@ typedef uint32_t n_long; /* long as received from the net */ #ifdef _MSC_VER # define PACKED_BEGIN __pragma( pack(push, 1) ) # define PACKED_END __pragma( pack(pop) ) -# define QEMU_PACKED #else # define PACKED_BEGIN #if defined(_WIN32) # define PACKED_END __attribute__((gcc_struct, packed)) -# define QEMU_PACKED __attribute__((gcc_struct, packed)) #else # define PACKED_END __attribute__((packed)) -# define QEMU_PACKED __attribute__((packed)) #endif #endif