From d55401d3fc693ec44fda7f9e97f12885e1c667bf Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 2 Apr 2020 01:29:19 +0900 Subject: [PATCH] examples/udp: Avoid conflicts with host OS definitions --- examples/udp/udp.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/udp/udp.h b/examples/udp/udp.h index f18db12f1..5956ab975 100644 --- a/examples/udp/udp.h +++ b/examples/udp/udp.h @@ -55,14 +55,18 @@ /* HTONS/L macros are unique to uIP-based networks */ # ifdef CONFIG_ENDIAN_BIG +# undef HTONS # define HTONS(ns) (ns) +# undef HTONL # define HTONL(nl) (nl) # else +# undef HTONS # define HTONS(ns) \ (unsigned short) \ (((((unsigned short)(ns)) & 0x00ff) << 8) | \ ((((unsigned short)(ns)) >> 8) & 0x00ff)) -# define HTONL(nl) \ +# undef HTONL +# define HTONL(nl) \ (unsigned long) \ (((((unsigned long)(nl)) & 0x000000ffUL) << 24) | \ ((((unsigned long)(nl)) & 0x0000ff00UL) << 8) | \ @@ -70,7 +74,9 @@ ((((unsigned long)(nl)) & 0xff000000UL) >> 24)) # endif +# undef NTOHS # define NTOHS(hs) HTONS(hs) +# undef NTOHL # define NTOHL(hl) HTONL(hl) # define FAR #endif