diff dvdread/libdvdread_changes.diff @ 24080:97a8394bec58

Replace dvdread bswap.h by something more sane for us.
author reimar
date Sun, 19 Aug 2007 09:07:56 +0000
parents aeb5561cf68b
children cda2c4f38003
line wrap: on
line diff
--- a/dvdread/libdvdread_changes.diff	Sun Aug 19 08:50:58 2007 +0000
+++ b/dvdread/libdvdread_changes.diff	Sun Aug 19 09:07:56 2007 +0000
@@ -1,53 +1,3 @@
---- dvdread.orig/bswap.h	2007-08-16 09:18:58.000000000 +0200
-+++ dvdread/bswap.h	2007-08-16 09:19:02.000000000 +0200
-@@ -83,8 +87,46 @@
- #define B2N_32(x) x = OSSwapBigToHostConstInt32(x)
- #define B2N_64(x) x = OSSwapBigToHostConstInt64(x)
- 
-+#elif defined(ARCH_X86)
-+inline static unsigned short bswap_16(unsigned short x)
-+{
-+  __asm("xchgb %b0,%h0" :
-+        "=q" (x)        :
-+        "0" (x));
-+    return x;
-+}
-+#define B2N_16(x) x = bswap_16(x)
-+
-+inline static unsigned int bswap_32(unsigned int x)
-+{
-+ __asm(
-+#if __CPU__ != 386
-+      "bswap   %0":
-+      "=r" (x)     :
- #else
--#if defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__BEOS__) || defined(__INTERIX)
-+      "xchgb   %b0,%h0\n"
-+      " rorl    $16,%0\n"
-+      " xchgb   %b0,%h0":
-+      "=q" (x)          :
-+#endif
-+      "0" (x));
-+  return x;
-+}
-+#define B2N_32(x) x = bswap_32(x)
-+
-+inline static unsigned long long int bswap_64(unsigned long long int x)
-+{
-+  register union { __extension__ uint64_t __ll;
-+          uint32_t __l[2]; } __x;
-+  asm("xchgl    %0,%1":
-+      "=r"(__x.__l[0]),"=r"(__x.__l[1]):
-+      "0"(bswap_32((unsigned long)x)),"1"(bswap_32((unsigned long)(x>>32))));
-+  return __x.__ll;
-+}
-+#define B2N_64(x) x = bswap_64(x)
-+
-+#else
-+#if defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__BEOS__) || defined(__INTERIX) || defined(__CYGWIN__)
- /* These systems don't have swap macros */
- #else
- /* If there isn't a header provided with your system with this functionality
 --- dvdread.orig/dvd_reader.c	2007-08-06 13:34:37.000000000 +0200
 +++ dvdread/dvd_reader.c	2007-08-06 13:35:19.000000000 +0200
 @@ -39,9 +43,11 @@