diff --git a/slirp/debug.h b/slirp/debug.h index 1fc29264..85f66405 100644 --- a/slirp/debug.h +++ b/slirp/debug.h @@ -44,12 +44,12 @@ extern void _sim_debug (int dbits, DEVICE* dptr, const char* fmt, ...); #else -#define DEBUG_CALL(x) -#define DEBUG_ARG(x, y) -#define DEBUG_ARGS(...) -#define DEBUG_MISC(...) -#define DEBUG_ERROR(...) -#define DPRINTF(fmt, ...) +#define DEBUG_CALL(x) do {} while (0) +#define DEBUG_ARG(x, y) do {} while (0) +#define DEBUG_ARGS(...) do {} while (0) +#define DEBUG_MISC(...) do {} while (0) +#define DEBUG_ERROR(...) do {} while (0) +#define DPRINTF(fmt, ...) do {} while (0) #endif #endif diff --git a/slirp/ip.h b/slirp/ip.h index c4bd07d8..b97baa77 100644 --- a/slirp/ip.h +++ b/slirp/ip.h @@ -59,6 +59,21 @@ 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 + /* * Definitions for internet protocol version 4. * Per RFC 791, September 1981. diff --git a/slirp/simh/qemu/compiler.h b/slirp/simh/qemu/compiler.h index 93fc210e..a9341c56 100644 --- a/slirp/simh/qemu/compiler.h +++ b/slirp/simh/qemu/compiler.h @@ -40,21 +40,6 @@ #define QEMU_ARTIFICIAL #endif -#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 - #ifndef glue #define xglue(x, y) x ## y #define glue(x, y) xglue(x, y)