slirp: Adjust code so it will build cleanly both in simh and QEMU

This commit is contained in:
Mark Pizzolato 2015-10-16 15:06:17 -07:00
parent b7f26877ab
commit dabdcfd2bd
3 changed files with 21 additions and 21 deletions

View file

@ -44,12 +44,12 @@ extern void _sim_debug (int dbits, DEVICE* dptr, const char* fmt, ...);
#else #else
#define DEBUG_CALL(x) #define DEBUG_CALL(x) do {} while (0)
#define DEBUG_ARG(x, y) #define DEBUG_ARG(x, y) do {} while (0)
#define DEBUG_ARGS(...) #define DEBUG_ARGS(...) do {} while (0)
#define DEBUG_MISC(...) #define DEBUG_MISC(...) do {} while (0)
#define DEBUG_ERROR(...) #define DEBUG_ERROR(...) do {} while (0)
#define DPRINTF(fmt, ...) #define DPRINTF(fmt, ...) do {} while (0)
#endif #endif
#endif #endif

View file

@ -59,6 +59,21 @@
typedef uint32_t n_long; /* long as received from the net */ 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. * Definitions for internet protocol version 4.
* Per RFC 791, September 1981. * Per RFC 791, September 1981.

View file

@ -40,21 +40,6 @@
#define QEMU_ARTIFICIAL #define QEMU_ARTIFICIAL
#endif #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 #ifndef glue
#define xglue(x, y) x ## y #define xglue(x, y) x ## y
#define glue(x, y) xglue(x, y) #define glue(x, y) xglue(x, y)