slirp: Avoid statements without effect on Big Endian host

Darwin has HTON*/NTOH* macros that on BE simply return the argument.
This is incompatible with SLIRP's use of these macros as a statement.

Undefine the macros in the HOST_WORDS_BIGENDIAN code path to redefine
these macros as no-op, as already done when they were undefined.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Andreas Färber 2012-05-28 19:34:20 +02:00 committed by Jan Kiszka
parent e20e48a802
commit 9b24d8e987
1 changed files with 8 additions and 12 deletions

View File

@ -34,18 +34,14 @@
#define _IP_H_ #define _IP_H_
#ifdef HOST_WORDS_BIGENDIAN #ifdef HOST_WORDS_BIGENDIAN
# ifndef NTOHL # undef NTOHL
# define NTOHL(d) # undef NTOHS
# endif # undef HTONL
# ifndef NTOHS # undef HTONS
# define NTOHS(d) # define NTOHL(d)
# endif # define NTOHS(d)
# ifndef HTONL # define HTONL(d)
# define HTONL(d) # define HTONS(d)
# endif
# ifndef HTONS
# define HTONS(d)
# endif
#else #else
# ifndef NTOHL # ifndef NTOHL
# define NTOHL(d) ((d) = ntohl((d))) # define NTOHL(d) ((d) = ntohl((d)))