You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/04/02 10:40:09 UTC

[incubator-nuttx-apps] 02/04: examples/udp: Avoid conflicts with host OS definitions

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit d55401d3fc693ec44fda7f9e97f12885e1c667bf
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Apr 2 01:29:19 2020 +0900

    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 f18db12..5956ab9 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