提交 9b24d8e9 编写于 作者: A Andreas Färber 提交者: Jan Kiszka

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: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NAndreas Färber <andreas.faerber@web.de>
Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
上级 e20e48a8
......@@ -34,18 +34,14 @@
#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)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册