[DVDnav-discuss] r875 - trunk/libdvdnav/src/dvdread/bswap.h

nicodvb subversion at mplayerhq.hu
Mon Apr 16 23:24:01 CEST 2007


Author: nicodvb
Date: Mon Apr 16 23:24:01 2007
New Revision: 875

Modified:
   trunk/libdvdnav/src/dvdread/bswap.h

Log:
support for non-linux GLIBC-based systems and OSX; patch by Diego Petteno' (flameeyes gmail com)

Modified: trunk/libdvdnav/src/dvdread/bswap.h
==============================================================================
--- trunk/libdvdnav/src/dvdread/bswap.h	(original)
+++ trunk/libdvdnav/src/dvdread/bswap.h	Mon Apr 16 23:24:01 2007
@@ -35,12 +35,18 @@
 #include <sys/param.h>
 #endif
 
-#if defined(__linux__)
+#if defined(__linux__) || defined(__GLIBC__)
 #include <byteswap.h>
 #define B2N_16(x) x = bswap_16(x)
 #define B2N_32(x) x = bswap_32(x)
 #define B2N_64(x) x = bswap_64(x)
 
+#elif defined(__APPLE__)
+#include <libkern/OSByteOrder.h>
+#define B2N_16(x) x = OSSwapBigToHostInt16(x)
+#define B2N_32(x) x = OSSwapBigToHostInt32(x)
+#define B2N_64(x) x = OSSwapBigToHostInt64(x)
+
 #elif defined(__NetBSD__)
 #include <sys/endian.h>
 #define B2N_16(x) BE16TOH(x)



More information about the DVDnav-discuss mailing list