comparison dvdread/bswap.h @ 24050:1542693b2a30

Sync libdvdread with version 0.9.5 (cosmetic changes).
author diego
date Wed, 15 Aug 2007 11:57:30 +0000
parents de28f9e8cb00
children 054b7bdb3b59
comparison
equal deleted inserted replaced
24049:39b8ccb91251 24050:1542693b2a30
1 /* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */
1 #ifndef BSWAP_H_INCLUDED 2 #ifndef BSWAP_H_INCLUDED
2 #define BSWAP_H_INCLUDED 3 #define BSWAP_H_INCLUDED
3 4
4 /* 5 /*
5 * Copyright (C) 2000, 2001 Billy Biggs <vektor@dumbterm.net>, 6 * Copyright (C) 2000, 2001 Billy Biggs <vektor@dumbterm.net>,
124 * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such 125 * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such
125 * functionality! 126 * functionality!
126 */ 127 */
127 128
128 #elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__BEOS__) || defined(__INTERIX) || defined(__CYGWIN__) 129 #elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__BEOS__) || defined(__INTERIX) || defined(__CYGWIN__)
129 #define B2N_16(x) \ 130 #define B2N_16(x) \
130 x = ((((x) & 0xff00) >> 8) | \ 131 x = ((((x) & 0xff00) >> 8) | \
131 (((x) & 0x00ff) << 8)) 132 (((x) & 0x00ff) << 8))
132 #define B2N_32(x) \ 133 #define B2N_32(x) \
133 x = ((((x) & 0xff000000) >> 24) | \ 134 x = ((((x) & 0xff000000) >> 24) | \
134 (((x) & 0x00ff0000) >> 8) | \ 135 (((x) & 0x00ff0000) >> 8) | \
135 (((x) & 0x0000ff00) << 8) | \ 136 (((x) & 0x0000ff00) << 8) | \
136 (((x) & 0x000000ff) << 24)) 137 (((x) & 0x000000ff) << 24))
137 #define B2N_64(x) \ 138 #define B2N_64(x) \
138 x = ((((x) & 0xff00000000000000) >> 56) | \ 139 x = ((((x) & 0xff00000000000000) >> 56) | \
139 (((x) & 0x00ff000000000000) >> 40) | \ 140 (((x) & 0x00ff000000000000) >> 40) | \
140 (((x) & 0x0000ff0000000000) >> 24) | \ 141 (((x) & 0x0000ff0000000000) >> 24) | \
141 (((x) & 0x000000ff00000000) >> 8) | \ 142 (((x) & 0x000000ff00000000) >> 8) | \
142 (((x) & 0x00000000ff000000) << 8) | \ 143 (((x) & 0x00000000ff000000) << 8) | \
143 (((x) & 0x0000000000ff0000) << 24) | \ 144 (((x) & 0x0000000000ff0000) << 24) | \
144 (((x) & 0x000000000000ff00) << 40) | \ 145 (((x) & 0x000000000000ff00) << 40) | \
145 (((x) & 0x00000000000000ff) << 56)) 146 (((x) & 0x00000000000000ff) << 56))
146 147
147 #else 148 #else
148 149
149 /* If there isn't a header provided with your system with this functionality 150 /* If there isn't a header provided with your system with this functionality
150 * add the relevant || define( ) to the portable implementation above. 151 * add the relevant || define( ) to the portable implementation above.