OSDN Git Service

Fixed Mac OS X support.
authorresver <resver@60bc1c72-a15a-11de-b98f-4500b42dc123>
Thu, 14 Jan 2010 19:15:09 +0000 (19:15 +0000)
committerresver <resver@60bc1c72-a15a-11de-b98f-4500b42dc123>
Thu, 14 Jan 2010 19:15:09 +0000 (19:15 +0000)
git-svn-id: http://exfat.googlecode.com/svn/trunk@113 60bc1c72-a15a-11de-b98f-4500b42dc123

libexfat/byteorder.h

index 4a7cf07..d125f40 100644 (file)
 #define BYTEORDER_H_INCLUDED
 
 #include <stdint.h>
+
+#ifdef __APPLE__
+#include <machine/endian.h>
+#include <libkern/OSByteOrder.h>
+#define bswap_16(x) OSSwapInt16(x)
+#define bswap_32(x) OSSwapInt32(x)
+#define bswap_64(x) OSSwapInt64(x)
+#else
 #include <endian.h>
 #include <byteswap.h>
+#endif
 
 typedef struct { uint16_t __u16; } le16_t;
 typedef struct { uint32_t __u32; } le32_t;