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,39 +51,35 @@
* Pre-processor Definitions
****************************************************************************/
#ifndef HTONS
# ifdef CONFIG_ENDIAN_BIG
# define HTONS(ns) (ns)
# else
# define HTONS(ns) \
#ifdef TCPBLASTER_HOST
#undef HTONS
#ifdef CONFIG_ENDIAN_BIG
# define HTONS(ns) (ns)
#else
# define HTONS(ns) \
(unsigned short) \
(((((unsigned short)(ns)) & 0x00ff) << 8) | \
((((unsigned short)(ns)) >> 8) & 0x00ff))
# endif
#endif
#ifndef HTONL
# ifdef CONFIG_ENDIAN_BIG
# define HTONL(nl) (nl)
# else
# define HTONL(nl) \
(unsigned long) \
(((((unsigned long)(nl)) & 0x000000ffUL) << 24) | \
((((unsigned long)(nl)) & 0x0000ff00UL) << 8) | \
((((unsigned long)(nl)) & 0x00ff0000UL) >> 8) | \
((((unsigned long)(nl)) & 0xff000000UL) >> 24))
# endif
#undef HTONL
#ifdef CONFIG_ENDIAN_BIG
# define HTONL(nl) (nl)
#else
# define HTONL(nl) \
(unsigned long) \
(((((unsigned long)(nl)) & 0x000000ffUL) << 24) | \
((((unsigned long)(nl)) & 0x0000ff00UL) << 8) | \
((((unsigned long)(nl)) & 0x00ff0000UL) >> 8) | \
((((unsigned long)(nl)) & 0xff000000UL) >> 24))
#endif
#ifndef NTOHS
# define NTOHS(hs) HTONS(hs)
#endif
#undef NTOHS
#define NTOHS(hs) HTONS(hs)
#ifndef NTOHL
# define NTOHL(hl) HTONL(hl)
#endif
#undef NTOHL
#define NTOHL(hl) HTONL(hl)
#ifdef TCPBLASTER_HOST
/* Have SO_LINGER */
# define FAR