summaryrefslogtreecommitdiffstats
path: root/contrib/libdvdread/P04-mingw-endian-macros.patch
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libdvdread/P04-mingw-endian-macros.patch')
-rw-r--r--contrib/libdvdread/P04-mingw-endian-macros.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/contrib/libdvdread/P04-mingw-endian-macros.patch b/contrib/libdvdread/P04-mingw-endian-macros.patch
new file mode 100644
index 000000000..872b8518d
--- /dev/null
+++ b/contrib/libdvdread/P04-mingw-endian-macros.patch
@@ -0,0 +1,29 @@
+diff -Naur libdvdread.orig/dvdread/bswap.h libdvdread/dvdread/bswap.h
+--- libdvdread.orig/dvdread/bswap.h 2006-06-06 16:03:37.000000000 -0400
++++ libdvdread/dvdread/bswap.h 2009-03-13 21:05:23.000000000 -0400
+@@ -83,6 +83,25 @@
+ #define B2N_32(x) x = OSSwapBigToHostConstInt32(x)
+ #define B2N_64(x) x = OSSwapBigToHostConstInt64(x)
+
++#elif defined(__MINGW32__)
++#define B2N_16(x) \
++ x = ((((x) & 0xff00) >> 8) | \
++ (((x) & 0x00ff) << 8))
++#define B2N_32(x) \
++ x = ((((x) & 0xff000000) >> 24) | \
++ (((x) & 0x00ff0000) >> 8) | \
++ (((x) & 0x0000ff00) << 8) | \
++ (((x) & 0x000000ff) << 24))
++#define B2N_64(x) \
++ x = ((((x) & 0xff00000000000000ULL) >> 56) | \
++ (((x) & 0x00ff000000000000ULL) >> 40) | \
++ (((x) & 0x0000ff0000000000ULL) >> 24) | \
++ (((x) & 0x000000ff00000000ULL) >> 8) | \
++ (((x) & 0x00000000ff000000ULL) << 8) | \
++ (((x) & 0x0000000000ff0000ULL) << 24) | \
++ (((x) & 0x000000000000ff00ULL) << 40) | \
++ (((x) & 0x00000000000000ffULL) << 56))
++
+ #else
+ #if defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__BEOS__) || defined(__INTERIX)
+ /* These systems don't have swap macros */