summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authormike <mike@FreeBSD.org>2002-09-23 04:32:17 +0000
committermike <mike@FreeBSD.org>2002-09-23 04:32:17 +0000
commitfb4d714b00676a2c13be7b3ff5b5fbf418c2e40b (patch)
treead7926a9810fc157f35d5f4b75967c4d275920dc /sys/i386
parent44f67149a75cbc8e6ca50ff4182ce07e0fce9815 (diff)
downloadFreeBSD-src-fb4d714b00676a2c13be7b3ff5b5fbf418c2e40b.zip
FreeBSD-src-fb4d714b00676a2c13be7b3ff5b5fbf418c2e40b.tar.gz
Be careful not to define GCC-specific optimizations in the non-GCC
case.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/include/endian.h13
1 files changed, 11 insertions, 2 deletions
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_ */
OpenPOWER on IntegriCloud