comparison liba52/bitstream.h @ 27453:bbcf29a2733d

Rename always_inline macro to av_always_inline so as not to clash with with __attribute__((always_inline)) declarations. This fixes the build on Mac OS X 10.4.11.
author diego
date Tue, 26 Aug 2008 21:29:54 +0000
parents 29548d0a768a
children 2eb96f52529a
comparison
equal deleted inserted replaced
27452:ead4f7641514 27453:bbcf29a2733d
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 */ 26 */
27 27
28 /* code from ffmpeg/libavcodec */ 28 /* code from ffmpeg/libavcodec */
29 #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC_ == 3 && __GNUC_MINOR__ > 0) 29 #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC_ == 3 && __GNUC_MINOR__ > 0)
30 # define always_inline __attribute__((always_inline)) inline 30 # define av_always_inline __attribute__((always_inline)) inline
31 #else 31 #else
32 # define always_inline inline 32 # define av_always_inline inline
33 #endif 33 #endif
34 34
35 #if defined(__sparc__) || defined(hpux) 35 #if defined(__sparc__) || defined(hpux)
36 /* 36 /*
37 * the alt bitstream reader performs unaligned memory accesses; that doesn't work 37 * the alt bitstream reader performs unaligned memory accesses; that doesn't work
45 /* used to avoid misaligned exceptions on some archs (alpha, ...) */ 45 /* used to avoid misaligned exceptions on some archs (alpha, ...) */
46 #if defined (ARCH_X86) || defined(HAVE_ARMV6) 46 #if defined (ARCH_X86) || defined(HAVE_ARMV6)
47 # define unaligned32(a) (*(uint32_t*)(a)) 47 # define unaligned32(a) (*(uint32_t*)(a))
48 #else 48 #else
49 # ifdef __GNUC__ 49 # ifdef __GNUC__
50 static always_inline uint32_t unaligned32(const void *v) { 50 static av_always_inline uint32_t unaligned32(const void *v) {
51 struct Unaligned { 51 struct Unaligned {
52 uint32_t i; 52 uint32_t i;
53 } __attribute__((packed)); 53 } __attribute__((packed));
54 54
55 return ((const struct Unaligned *) v)->i; 55 return ((const struct Unaligned *) v)->i;
84 } 84 }
85 85
86 # else 86 # else
87 87
88 # define swab32(x) __generic_swab32(x) 88 # define swab32(x) __generic_swab32(x)
89 static always_inline const uint32_t __generic_swab32(uint32_t x) 89 static av_always_inline const uint32_t __generic_swab32(uint32_t x)
90 { 90 {
91 return ((((uint8_t*)&x)[0] << 24) | (((uint8_t*)&x)[1] << 16) | 91 return ((((uint8_t*)&x)[0] << 24) | (((uint8_t*)&x)[1] << 16) |
92 (((uint8_t*)&x)[2] << 8) | (((uint8_t*)&x)[3])); 92 (((uint8_t*)&x)[2] << 8) | (((uint8_t*)&x)[3]));
93 } 93 }
94 # endif 94 # endif