mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-11-06 05:17:42 +00:00
avutil: remove always-true GCC version checks in internal headers
Every GCC able to pass the C11 configure check provides these builtins, attributes and pragmas. Public headers are left untouched since they must keep working with C99 compilers. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
3 files changed
+8
-8
No files matched your search
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "attributes.h"
|
||||
|
||||
#if (AV_GCC_VERSION_AT_LEAST(4,0) || defined(__clang__)) && (defined(__ELF__) || defined(__MACH__))
|
||||
#if (defined(__GNUC__) || defined(__clang__)) && (defined(__ELF__) || defined(__MACH__))
|
||||
# define attribute_visibility_hidden __attribute__((visibility("hidden")))
|
||||
# define FF_VISIBILITY_PUSH_HIDDEN _Pragma("GCC visibility push(hidden)")
|
||||
# define FF_VISIBILITY_POP_HIDDEN _Pragma("GCC visibility pop")
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "macros.h"
|
||||
|
||||
#ifndef attribute_align_arg
|
||||
#if ARCH_X86_32 && AV_GCC_VERSION_AT_LEAST(4,2)
|
||||
#if ARCH_X86_32 && defined(__GNUC__)
|
||||
# define attribute_align_arg __attribute__((force_align_arg_pointer))
|
||||
#else
|
||||
# define attribute_align_arg
|
||||
|
||||
+6
-6
@@ -35,14 +35,14 @@
|
||||
#endif
|
||||
|
||||
#if HAVE_FAST_CLZ
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,4) || AV_HAS_BUILTIN(__builtin_clz)
|
||||
#if defined(__GNUC__) || AV_HAS_BUILTIN(__builtin_clz)
|
||||
#ifndef ff_log2
|
||||
# define ff_log2(x) (31 - __builtin_clz((x)|1))
|
||||
# ifndef ff_log2_16bit
|
||||
# define ff_log2_16bit av_log2
|
||||
# endif
|
||||
#endif /* ff_log2 */
|
||||
#endif /* AV_GCC_VERSION_AT_LEAST(3,4) */
|
||||
#endif /* defined(__GNUC__) || AV_HAS_BUILTIN(__builtin_clz) */
|
||||
#endif
|
||||
|
||||
extern const uint8_t ff_log2_tab[256];
|
||||
@@ -90,13 +90,13 @@ static av_always_inline av_const int ff_log2_16bit_c(unsigned int v)
|
||||
*/
|
||||
|
||||
#if HAVE_FAST_CLZ
|
||||
#if !defined(ff_ctz) && (AV_GCC_VERSION_AT_LEAST(3,4) || AV_HAS_BUILTIN(__builtin_ctz))
|
||||
#if !defined(ff_ctz) && (defined(__GNUC__) || AV_HAS_BUILTIN(__builtin_ctz))
|
||||
#define ff_ctz(v) __builtin_ctz(v)
|
||||
#endif
|
||||
#if !defined(ff_ctzll) && (AV_GCC_VERSION_AT_LEAST(3,4) || AV_HAS_BUILTIN(__builtin_ctzll))
|
||||
#if !defined(ff_ctzll) && (defined(__GNUC__) || AV_HAS_BUILTIN(__builtin_ctzll))
|
||||
#define ff_ctzll(v) __builtin_ctzll(v)
|
||||
#endif
|
||||
#if !defined(ff_clz) && (AV_GCC_VERSION_AT_LEAST(3,4) || AV_HAS_BUILTIN(__builtin_clz))
|
||||
#if !defined(ff_clz) && (defined(__GNUC__) || AV_HAS_BUILTIN(__builtin_clz))
|
||||
#define ff_clz(v) __builtin_clz(v)
|
||||
#endif
|
||||
#endif
|
||||
@@ -152,7 +152,7 @@ static av_always_inline av_const unsigned ff_clz_c(unsigned x)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,4) || AV_HAS_BUILTIN(__builtin_parity)
|
||||
#if defined(__GNUC__) || AV_HAS_BUILTIN(__builtin_parity)
|
||||
#ifndef av_parity
|
||||
#define av_parity __builtin_parity
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user