summaryrefslogtreecommitdiffstats
path: root/dvdread/bswap.h
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-08-15 11:47:22 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-08-15 11:47:22 +0000
commit80dee3f8ac591919a1f78724d31049f5b4472f42 (patch)
tree03c83643049579a36c79840a2a2b0ab01f20da91 /dvdread/bswap.h
parent5d9b793edd1a692816c3c7a8d4dd8549f18fd1af (diff)
downloadmpv-80dee3f8ac591919a1f78724d31049f5b4472f42.tar.bz2
mpv-80dee3f8ac591919a1f78724d31049f5b4472f42.tar.xz
Sync libdvdread with version 0.9.5 (functional changes).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24067 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'dvdread/bswap.h')
-rw-r--r--dvdread/bswap.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/dvdread/bswap.h b/dvdread/bswap.h
index c612025b31..a5296b82cd 100644
--- a/dvdread/bswap.h
+++ b/dvdread/bswap.h
@@ -61,7 +61,19 @@
#include <sys/endian.h>
#define B2N_16(x) x = be16toh(x)
#define B2N_32(x) x = be32toh(x)
+#if __FreeBSD_version >= 500000
#define B2N_64(x) x = be64toh(x)
+#else
+#define B2N_64(x) \
+ x = ((((x) & 0xff00000000000000) >> 56) | \
+ (((x) & 0x00ff000000000000) >> 40) | \
+ (((x) & 0x0000ff0000000000) >> 24) | \
+ (((x) & 0x000000ff00000000) >> 8) | \
+ (((x) & 0x00000000ff000000) << 8) | \
+ (((x) & 0x0000000000ff0000) << 24) | \
+ (((x) & 0x000000000000ff00) << 40) | \
+ (((x) & 0x00000000000000ff) << 56))
+#endif /* _FreeBSD_version >= 500000 */
#elif defined(__DragonFly__)
#include <sys/endian.h>
@@ -113,7 +125,7 @@ inline static unsigned long long int bswap_64(unsigned long long int x)
* functionality!
*/
-#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(__CYGWIN__)
+#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__BEOS__) || defined(__INTERIX) || defined(__CYGWIN__)
#define B2N_16(x) \
x = ((((x) & 0xff00) >> 8) | \
(((x) & 0x00ff) << 8))