]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/hfs/hfs_endian.h
xnu-1228.5.18.tar.gz
[apple/xnu.git] / bsd / hfs / hfs_endian.h
index 004e36c1235119bfbc67671740497902b100c988..519c40104df3b0213d4d21d925da1643c3ed765c 100644 (file)
  */
 #include "hfs.h"
 #include "hfscommon/headers/BTreesInternal.h"
-#include <architecture/byte_order.h>
+#include <libkern/OSByteOrder.h>
 
 /*********************/
 /* BIG ENDIAN Macros */
 /*********************/
-#if BYTE_ORDER == BIG_ENDIAN
+#define SWAP_BE16(__a)                                                         OSSwapBigToHostInt16 (__a)
+#define SWAP_BE32(__a)                                                         OSSwapBigToHostInt32 (__a)
+#define SWAP_BE64(__a)                                                         OSSwapBigToHostInt64 (__a)
 
-    /* HFS is always big endian, make swaps into no-ops */
-    #define SWAP_BE16(__a) (__a)
-    #define SWAP_BE32(__a) (__a)
-    #define SWAP_BE64(__a) (__a)
+#if BYTE_ORDER == BIG_ENDIAN
     
     /* HFS is always big endian, no swapping needed */
     #define SWAP_HFS_PLUS_FORK_DATA(__a)
 /************************/
 #elif BYTE_ORDER == LITTLE_ENDIAN
 
-    /* HFS is always big endian, make swaps actually swap */
-    #define SWAP_BE16(__a)                                                     NXSwapBigShortToHost (__a)
-    #define SWAP_BE32(__a)                                                     NXSwapBigLongToHost (__a)
-    #define SWAP_BE64(__a)                                                     NXSwapBigLongLongToHost (__a)
-    
     #define SWAP_HFS_PLUS_FORK_DATA(__a)                       hfs_swap_HFSPlusForkData ((__a))
 
 #else