We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61bf85e commit 3fa6208Copy full SHA for 3fa6208
1 file changed
lib/Common/Common/ByteSwap.h
@@ -68,7 +68,14 @@ RtlUlonglongByteSwap(
68
#define RtlUlongByteSwap(_x) __bswap_32((_x))
69
#define RtlUlonglongByteSwap(_x) __bswap_64((_x))
70
71
+#elif defined(__FreeBSD__)
72
+#include <byteswap.h>
73
+/* FreeBSD 13+, also above definitions would work
74
+ * TODO replace with "has byteswap.h" check? */
75
+#define RtlUshortByteSwap(_x) bswap_16((_x))
76
+#define RtlUlongByteSwap(_x) bswap_32((_x))
77
+#define RtlUlonglongByteSwap(_x) bswap_64((_x))
78
+
79
#else
-// TODO: include endian.h for BSD?
80
#error "ByteSwap.h: Not implemented for this platform"
81
#endif
0 commit comments