Fw: [xine-cvs] HG: xine-lib: Support Solaris byteorder.h macros.
Forwarding one more fix applied to xine-lib now. Begin forwarded message: Date: Wed, 13 Jun 2007 21:31:02 +0000 From: Albert Lee <trisk+xine@acm.jhu.edu> To: xine-cvslog@lists.sourceforge.net Subject: [xine-cvs] HG: xine-lib: Support Solaris byteorder.h macros. # HG changeset patch # User Albert Lee <trisk+xine@acm.jhu.edu> # Date 1181770255 -7200 # Node ID 5082f1f32e32cceb246490acae76317f22d0be44 # Parent 1312dcc392d964d0892d6538b2bbec4d6600deac Support Solaris byteorder.h macros. diff -r 5082f1f32e32cceb246490acae76317f22d0be44 -r 1312dcc392d964d0892d6538b2bbec4d6600deac src/input/libdvdnav/bswap.h --- a/src/input/libdvdnav/bswap.h Wed Jun 13 23:30:55 2007 +0200 +++ b/src/input/libdvdnav/bswap.h Wed Jun 13 23:30:46 2007 +0200 @@ -41,6 +41,12 @@ #define B2N_32(x) x = bswap_32(x) #define B2N_64(x) x = bswap_64(x) +#elif defined(__SVR4) && defined(__sun) +#include <sys/byteorder.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) @@ -67,11 +73,11 @@ /* This is a slow but portable implementation, it has multiple evaluation * problems so beware. - * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such + * Old FreeBSD and Windows don't have <byteswap.h> or any other such * functionality! */ -#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__CYGWIN__) +#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(WIN32) || defined(__CYGWIN__) #define B2N_16(x) \ x = ((((x) & 0xff00) >> 8) | \ (((x) & 0x00ff) << 8)) -- Diego "Flameeyes" Pettenò http://farragut.flameeyes.is-a-geek.org/
Diego 'Flameeyes' Pettenò wrote:
Forwarding one more fix applied to xine-lib now.
Begin forwarded message:
Date: Wed, 13 Jun 2007 21:31:02 +0000 From: Albert Lee <trisk+xine@acm.jhu.edu> To: xine-cvslog@lists.sourceforge.net Subject: [xine-cvs] HG: xine-lib: Support Solaris byteorder.h macros.
# HG changeset patch # User Albert Lee <trisk+xine@acm.jhu.edu> # Date 1181770255 -7200 # Node ID 5082f1f32e32cceb246490acae76317f22d0be44 # Parent 1312dcc392d964d0892d6538b2bbec4d6600deac Support Solaris byteorder.h macros.
diff -r 5082f1f32e32cceb246490acae76317f22d0be44 -r 1312dcc392d964d0892d6538b2bbec4d6600deac src/input/libdvdnav/bswap.h --- a/src/input/libdvdnav/bswap.h Wed Jun 13 23:30:55 2007 +0200 +++ b/src/input/libdvdnav/bswap.h Wed Jun 13 23:30:46 2007 +0200 @@ -41,6 +41,12 @@ #define B2N_32(x) x = bswap_32(x) #define B2N_64(x) x = bswap_64(x)
+#elif defined(__SVR4) && defined(__sun) +#include <sys/byteorder.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) @@ -67,11 +73,11 @@
/* This is a slow but portable implementation, it has multiple evaluation * problems so beware. - * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such + * Old FreeBSD and Windows don't have <byteswap.h> or any other such * functionality! */
-#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__CYGWIN__) +#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(WIN32) || defined(__CYGWIN__) #define B2N_16(x) \ x = ((((x) & 0xff00) >> 8) | \ (((x) & 0x00ff) << 8))
this last part of the patch doesn't convince me: should we remove the fallback case where the macros are defined by ORs and SHIFTs? Can you send a proper patch, please? Nico
participants (2)
-
Diego 'Flameeyes' Pettenò -
Nico Sabbi