aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Barcroft <mike@FreeBSD.org>2002-09-23 04:32:17 +0000
committerMike Barcroft <mike@FreeBSD.org>2002-09-23 04:32:17 +0000
commitc0d4804d67d4b1b4d5df4778a1c718a918878050 (patch)
treead7926a9810fc157f35d5f4b75967c4d275920dc /sys
parent33e2cd4e8d347f9cee7de2158582c998d51f542b (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/include/endian.h13
-rw-r--r--sys/amd64/include/endian.h13
-rw-r--r--sys/i386/include/endian.h13
-rw-r--r--sys/ia64/include/endian.h13
-rw-r--r--sys/powerpc/include/endian.h13
-rw-r--r--sys/sparc64/include/endian.h13
6 files changed, 66 insertions, 12 deletions
diff --git a/sys/alpha/include/endian.h b/sys/alpha/include/endian.h
index 968d78c0542a..7906ea1eb7d8 100644
--- a/sys/alpha/include/endian.h
+++ b/sys/alpha/include/endian.h
@@ -112,11 +112,20 @@ __bswap16(__uint16_t __x)
return (__r);
}
-#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_ */
diff --git a/sys/amd64/include/endian.h b/sys/amd64/include/endian.h
index c979683c64e7..723a5f3d4fea 100644
--- a/sys/amd64/include/endian.h
+++ b/sys/amd64/include/endian.h
@@ -109,11 +109,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_ */
diff --git a/sys/i386/include/endian.h b/sys/i386/include/endian.h
index c8b86eed3516..d68653259ecb 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_ */
diff --git a/sys/ia64/include/endian.h b/sys/ia64/include/endian.h
index 7ba8bbfbb999..c3d42cc2fbd9 100644
--- a/sys/ia64/include/endian.h
+++ b/sys/ia64/include/endian.h
@@ -93,11 +93,20 @@ __bswap16(__uint16_t __x)
return (__bswap64(__x) >> 48);
}
-#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_ */
diff --git a/sys/powerpc/include/endian.h b/sys/powerpc/include/endian.h
index a0f08a057991..5d1c1cacad90 100644
--- a/sys/powerpc/include/endian.h
+++ b/sys/powerpc/include/endian.h
@@ -95,11 +95,20 @@ __bswap64(__uint64_t _x)
((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56)));
}
-#endif /* __GNUC__ */
-
#define __htonl(x) ((__uint32_t)(x))
#define __htons(x) ((__uint16_t)(x))
#define __ntohl(x) ((__uint32_t)(x))
#define __ntohs(x) ((__uint16_t)(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_ */
diff --git a/sys/sparc64/include/endian.h b/sys/sparc64/include/endian.h
index e8ee18400ae2..f10032c62799 100644
--- a/sys/sparc64/include/endian.h
+++ b/sys/sparc64/include/endian.h
@@ -94,11 +94,20 @@ __bswap64(__uint64_t _x)
((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56)));
}
-#endif /* __GNUC__ */
-
#define __htonl(x) ((__uint32_t)(x))
#define __htons(x) ((__uint16_t)(x))
#define __ntohl(x) ((__uint32_t)(x))
#define __ntohs(x) ((__uint16_t)(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_ */