diff options
author | Måns Rullgård <mans@mansr.com> | 2006-12-08 00:35:08 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2006-12-08 00:35:08 +0000 |
commit | 849f10351d673ced1db6f13e399876f22121f60c (patch) | |
tree | 779ae65e38d3070b7bf48ea6e6d89032a9e00521 /libavutil | |
parent | fb17fac8c7dd92c77cf93019510e15fdae418d16 (diff) | |
download | ffmpeg-849f10351d673ced1db6f13e399876f22121f60c.tar.gz |
rename always_inline to av_always_inline and move to common.h
Originally committed as revision 7256 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/bswap.h | 14 | ||||
-rw-r--r-- | libavutil/common.h | 11 | ||||
-rw-r--r-- | libavutil/internal.h | 10 |
3 files changed, 19 insertions, 16 deletions
diff --git a/libavutil/bswap.h b/libavutil/bswap.h index 4614c90458..03d613db2d 100644 --- a/libavutil/bswap.h +++ b/libavutil/bswap.h @@ -37,7 +37,7 @@ #endif #if defined(ARCH_X86) -static always_inline uint16_t bswap_16(uint16_t x) +static av_always_inline uint16_t bswap_16(uint16_t x) { __asm("rorw $8, %0" : LEGACY_REGS (x) : @@ -45,7 +45,7 @@ static always_inline uint16_t bswap_16(uint16_t x) return x; } -static always_inline uint32_t bswap_32(uint32_t x) +static av_always_inline uint32_t bswap_32(uint32_t x) { #if __CPU__ != 386 __asm("bswap %0": @@ -82,12 +82,12 @@ static inline uint64_t bswap_64(uint64_t x) #elif defined(ARCH_SH4) -static always_inline uint16_t bswap_16(uint16_t x) { +static av_always_inline uint16_t bswap_16(uint16_t x) { __asm__("swap.b %0,%0":"=r"(x):"0"(x)); return x; } -static always_inline uint32_t bswap_32(uint32_t x) { +static av_always_inline uint32_t bswap_32(uint32_t x) { __asm__( "swap.b %0,%0\n" "swap.w %0,%0\n" @@ -110,12 +110,12 @@ static inline uint64_t bswap_64(uint64_t x) } #else -static always_inline uint16_t bswap_16(uint16_t x){ +static av_always_inline uint16_t bswap_16(uint16_t x){ return (x>>8) | (x<<8); } #ifdef ARCH_ARM -static always_inline uint32_t bswap_32(uint32_t x){ +static av_always_inline uint32_t bswap_32(uint32_t x){ uint32_t t; __asm__ ( "eor %1, %0, %0, ror #16 \n\t" @@ -126,7 +126,7 @@ static always_inline uint32_t bswap_32(uint32_t x){ return x; } #else -static always_inline uint32_t bswap_32(uint32_t x){ +static av_always_inline uint32_t bswap_32(uint32_t x){ x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); return (x>>16) | (x<<16); } diff --git a/libavutil/common.h b/libavutil/common.h index d8baf12379..ca6147a802 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -43,6 +43,17 @@ # include "berrno.h" # endif # include <math.h> +#endif /* HAVE_AV_CONFIG_H */ + +#ifndef av_always_inline +#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) +# define av_always_inline __attribute__((always_inline)) inline +#else +# define av_always_inline inline +#endif +#endif + +#ifdef HAVE_AV_CONFIG_H # include "internal.h" #endif /* HAVE_AV_CONFIG_H */ diff --git a/libavutil/internal.h b/libavutil/internal.h index 6e3e47af0b..d498f99de6 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -26,14 +26,6 @@ #ifndef INTERNAL_H #define INTERNAL_H -#ifndef always_inline -#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define always_inline __attribute__((always_inline)) inline -#else -# define always_inline inline -#endif -#endif - #ifndef attribute_used #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) # define attribute_used __attribute__((used)) @@ -309,7 +301,7 @@ if((y)<(x)){\ /* XXX: add ISOC specific test to avoid specific BSD testing. */ /* better than nothing implementation. */ /* btw, rintf() is existing on fbsd too -- alex */ -static always_inline long int lrintf(float x) +static av_always_inline long int lrintf(float x) { #ifdef __MINGW32__ # ifdef ARCH_X86_32 |