tcpblaster: Avoid conflicting with host OS definitions

This commit is contained in:
YAMAMOTO Takashi 2020-03-30 15:22:39 +09:00 committed by Xiang Xiao
parent e8b0c903bc
commit 5f91364d44

View File

@ -51,7 +51,8 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
#ifndef HTONS #ifdef TCPBLASTER_HOST
#undef HTONS
#ifdef CONFIG_ENDIAN_BIG #ifdef CONFIG_ENDIAN_BIG
# define HTONS(ns) (ns) # define HTONS(ns) (ns)
#else #else
@ -60,9 +61,8 @@
(((((unsigned short)(ns)) & 0x00ff) << 8) | \ (((((unsigned short)(ns)) & 0x00ff) << 8) | \
((((unsigned short)(ns)) >> 8) & 0x00ff)) ((((unsigned short)(ns)) >> 8) & 0x00ff))
#endif #endif
#endif
#ifndef HTONL #undef HTONL
#ifdef CONFIG_ENDIAN_BIG #ifdef CONFIG_ENDIAN_BIG
# define HTONL(nl) (nl) # define HTONL(nl) (nl)
#else #else
@ -73,17 +73,13 @@
((((unsigned long)(nl)) & 0x00ff0000UL) >> 8) | \ ((((unsigned long)(nl)) & 0x00ff0000UL) >> 8) | \
((((unsigned long)(nl)) & 0xff000000UL) >> 24)) ((((unsigned long)(nl)) & 0xff000000UL) >> 24))
#endif #endif
#endif
#ifndef NTOHS #undef NTOHS
#define NTOHS(hs) HTONS(hs) #define NTOHS(hs) HTONS(hs)
#endif
#ifndef NTOHL #undef NTOHL
#define NTOHL(hl) HTONL(hl) #define NTOHL(hl) HTONL(hl)
#endif
#ifdef TCPBLASTER_HOST
/* Have SO_LINGER */ /* Have SO_LINGER */
# define FAR # define FAR