]> git.proxmox.com Git - mirror_qemu.git/commitdiff
slirp: Avoid statements without effect on Big Endian host
authorAndreas Färber <andreas.faerber@web.de>
Mon, 28 May 2012 17:34:20 +0000 (19:34 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Mon, 28 May 2012 20:31:07 +0000 (22:31 +0200)
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>
slirp/ip.h

index 88c903fccd186e7746a267741c58e28e440407a8..e2ee5e304cc520b795fc8195b0c029a13a6f5aee 100644 (file)
 #define _IP_H_
 
 #ifdef HOST_WORDS_BIGENDIAN
-# ifndef NTOHL
-#  define NTOHL(d)
-# endif
-# ifndef NTOHS
-#  define NTOHS(d)
-# endif
-# ifndef HTONL
-#  define HTONL(d)
-# endif
-# ifndef HTONS
-#  define HTONS(d)
-# endif
+# undef NTOHL
+# undef NTOHS
+# undef HTONL
+# undef HTONS
+# define NTOHL(d)
+# define NTOHS(d)
+# define HTONL(d)
+# define HTONS(d)
 #else
 # ifndef NTOHL
 #  define NTOHL(d) ((d) = ntohl((d)))