Build on Mac OS 10.9 by using libkern/OSByteOrder.h
authorPhil Calvin <phil@philcalvin.com>
Sat, 8 Feb 2014 04:14:52 +0000 (23:14 -0500)
committerPhil Calvin <phil@philcalvin.com>
Sat, 8 Feb 2014 04:14:52 +0000 (23:14 -0500)
fwcutter/fwcutter.c
fwcutter/fwcutter.h

index e9082f95fbeca1146a57b8047efa4dcdabb6fcf9..3591eb2620401dd27558d7d3b2be9e8c60a909de 100644 (file)
@@ -40,6 +40,8 @@
 
 #if defined(__DragonFly__) || defined(__FreeBSD__)
 #include <sys/endian.h>
+#elif defined(__APPLE__)
+#include <libkern/OSByteOrder.h>
 #else
 #include <byteswap.h>
 #endif
index a441322aded7b302f11bd8c1ebbf8446415acdcb..3b04c66789440eabed4bd6de2737098c2df6458b 100644 (file)
@@ -20,6 +20,9 @@ typedef uint32_t le32_t; /* Little-endian 32bit */
 #if defined(__DragonFly__) || defined(__FreeBSD__)
 #define bswap_16       bswap16
 #define bswap_32       bswap32
+#elif defined(__APPLE__)
+#define bswap_16       OSSwapInt16
+#define bswap_32       OSSwapInt32
 #endif
 
 #define ARG_MATCH      0