examples/udp: Avoid conflicts with host OS definitions

This commit is contained in:
YAMAMOTO Takashi 2020-04-02 01:29:19 +09:00 committed by Abdelatif Guettouche
parent d79de16657
commit d55401d3fc

View File

@ -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