aboutsummaryrefslogtreecommitdiff
path: root/slirp/ip.h
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-11-14 16:36:26 +0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-01-14 00:40:54 +0100
commite429f29602098b0cd62eb375ec1ffea913afb675 (patch)
tree795b4e642a34656f53af7a0f74861345a6011462 /slirp/ip.h
parent1e9ba46dd0f2b1d21feb675715f5114c0073d822 (diff)
downloadqemu-e429f29602098b0cd62eb375ec1ffea913afb675.zip
qemu-e429f29602098b0cd62eb375ec1ffea913afb675.tar.gz
qemu-e429f29602098b0cd62eb375ec1ffea913afb675.tar.bz2
slirp: replace HOST_WORDS_BIGENDIAN with glib equivalent
One more step towards making the project independent from QEMU. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/ip.h')
-rw-r--r--slirp/ip.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/slirp/ip.h b/slirp/ip.h
index 59cf4aa..83fc9cd 100644
--- a/slirp/ip.h
+++ b/slirp/ip.h
@@ -33,7 +33,9 @@
#ifndef IP_H
#define IP_H
-#ifdef HOST_WORDS_BIGENDIAN
+#include <glib.h>
+
+#if G_BYTE_ORDER == G_BIG_ENDIAN
# undef NTOHL
# undef NTOHS
# undef HTONL
@@ -69,7 +71,7 @@ typedef uint32_t n_long; /* long as received from the net */
* Structure of an internet header, naked of options.
*/
struct ip {
-#ifdef HOST_WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
uint8_t ip_v:4, /* version */
ip_hl:4; /* header length */
#else
@@ -135,7 +137,7 @@ struct ip_timestamp {
uint8_t ipt_code; /* IPOPT_TS */
uint8_t ipt_len; /* size of structure (variable) */
uint8_t ipt_ptr; /* index of current entry */
-#ifdef HOST_WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
uint8_t ipt_oflw:4, /* overflow counter */
ipt_flg:4; /* flags, see below */
#else