From fb4d714b00676a2c13be7b3ff5b5fbf418c2e40b Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 23 Sep 2002 04:32:17 +0000 Subject: Be careful not to define GCC-specific optimizations in the non-GCC case. --- sys/i386/include/endian.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'sys/i386') diff --git a/sys/i386/include/endian.h b/sys/i386/include/endian.h index c8b86ee..d686532 100644 --- a/sys/i386/include/endian.h +++ b/sys/i386/include/endian.h @@ -117,11 +117,20 @@ __bswap16(__uint16_t _x) return (__byte_swap_word(_x)); } -#endif /* __GNUC__ */ - #define __htonl(x) __bswap32(x) #define __htons(x) __bswap16(x) #define __ntohl(x) __bswap32(x) #define __ntohs(x) __bswap16(x) +#else /* !__GNUC__ */ + +/* + * No optimizations are available for this compiler. Fall back to + * non-optimized functions by defining the constant usually used to prevent + * redefinition. + */ +#define _BYTEORDER_FUNC_DEFINED + +#endif /* __GNUC__ */ + #endif /* !_MACHINE_ENDIAN_H_ */ -- cgit v1.1