diff options
author | aurel <aurel@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-06-30 22:48:26 +0000 |
---|---|---|
committer | aurel <aurel@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-06-30 22:48:26 +0000 |
commit | eb3c1b5cedfc1b7d35a2d261780979b00170946e (patch) | |
tree | ccc33eb81679684b7f2ca3d7c610d721375c4ea5 /libmpdvdkit2/bswap.h | |
parent | c8fbf4405d7b433f0dc622bc9dcf81d0ceb5ef36 (diff) | |
download | mpv-eb3c1b5cedfc1b7d35a2d261780979b00170946e.tar.bz2 mpv-eb3c1b5cedfc1b7d35a2d261780979b00170946e.tar.xz |
update libdvdread to v0.9.4
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15875 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdvdkit2/bswap.h')
-rw-r--r-- | libmpdvdkit2/bswap.h | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/libmpdvdkit2/bswap.h b/libmpdvdkit2/bswap.h index 240f06e16f..7b5e7448f2 100644 --- a/libmpdvdkit2/bswap.h +++ b/libmpdvdkit2/bswap.h @@ -32,6 +32,11 @@ #else +/* For __FreeBSD_version */ +#if defined(HAVE_SYS_PARAM_H) +#include <sys/param.h> +#endif + #if defined(__linux__) #include <byteswap.h> #define B2N_16(x) x = bswap_16(x) @@ -50,6 +55,18 @@ #define B2N_32(x) x = swap32(x) #define B2N_64(x) x = swap64(x) +#elif defined(__FreeBSD__) && __FreeBSD_version >= 470000 +#include <sys/endian.h> +#define B2N_16(x) x = be16toh(x) +#define B2N_32(x) x = be32toh(x) +#define B2N_64(x) x = be64toh(x) + +#elif defined(__DragonFly__) +#include <sys/endian.h> +#define B2N_16(x) x = be16toh(x) +#define B2N_32(x) x = be32toh(x) +#define B2N_64(x) x = be64toh(x) + #elif defined(ARCH_X86) inline static unsigned short bswap_16(unsigned short x) { @@ -88,17 +105,12 @@ inline static unsigned long long int bswap_64(unsigned long long int x) } #define B2N_64(x) x = bswap_64(x) -#elif defined(__DragonFly__) -#include <sys/endian.h> -#define B2N_16(x) x = be16toh(x) -#define B2N_32(x) x = be32toh(x) -#define B2N_64(x) x = be64toh(x) - /* This is a slow but portable implementation, it has multiple evaluation * problems so beware. - * FreeBSD and Solaris don't have <byteswap.h> or any other such + * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such * functionality! */ + #elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(__CYGWIN__) #define B2N_16(x) \ x = ((((x) & 0xff00) >> 8) | \ |