Commit 97d669a8 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove ifdefs for GCC version below 4.4

According to INSTALL, we require GCC 4.8 already.
parent 72d6528f
...@@ -84,20 +84,14 @@ ...@@ -84,20 +84,14 @@
#ifdef __GNUC__ #ifdef __GNUC__
# define VLC_DEPRECATED __attribute__((deprecated)) # define VLC_DEPRECATED __attribute__((deprecated))
# if defined( _WIN32 ) && VLC_GCC_VERSION(4,4) # if defined( _WIN32 )
# define VLC_FORMAT(x,y) __attribute__ ((format(gnu_printf,x,y))) # define VLC_FORMAT(x,y) __attribute__ ((format(gnu_printf,x,y)))
# else # else
# define VLC_FORMAT(x,y) __attribute__ ((format(printf,x,y))) # define VLC_FORMAT(x,y) __attribute__ ((format(printf,x,y)))
# endif # endif
# define VLC_FORMAT_ARG(x) __attribute__ ((format_arg(x))) # define VLC_FORMAT_ARG(x) __attribute__ ((format_arg(x)))
# define VLC_MALLOC __attribute__ ((malloc)) # define VLC_MALLOC __attribute__ ((malloc))
# define VLC_USED __attribute__ ((warn_unused_result))
# if VLC_GCC_VERSION(3,4)
# define VLC_USED __attribute__ ((warn_unused_result))
# else
# define VLC_USED
# endif
#else #else
# define VLC_DEPRECATED # define VLC_DEPRECATED
...@@ -130,7 +124,7 @@ ...@@ -130,7 +124,7 @@
#if defined (_WIN32) && defined (DLL_EXPORT) #if defined (_WIN32) && defined (DLL_EXPORT)
# define VLC_EXPORT __declspec(dllexport) # define VLC_EXPORT __declspec(dllexport)
#elif VLC_GCC_VERSION(4,0) #elif defined (__GNUC__)
# define VLC_EXPORT __attribute__((visibility("default"))) # define VLC_EXPORT __attribute__((visibility("default")))
#else #else
# define VLC_EXPORT # define VLC_EXPORT
...@@ -477,7 +471,7 @@ struct vlc_common_members ...@@ -477,7 +471,7 @@ struct vlc_common_members
struct vlc_common_members: (vlc_object_t *)(&(x)->obj), \ struct vlc_common_members: (vlc_object_t *)(&(x)->obj), \
const struct vlc_common_members: (const vlc_object_t *)(&(x)->obj) \ const struct vlc_common_members: (const vlc_object_t *)(&(x)->obj) \
) )
#elif VLC_GCC_VERSION(4,0) #elif defined (__GNUC__)
# ifndef __cplusplus # ifndef __cplusplus
# define VLC_OBJECT( x ) \ # define VLC_OBJECT( x ) \
__builtin_choose_expr( \ __builtin_choose_expr( \
...@@ -537,7 +531,7 @@ static inline uint8_t clip_uint8_vlc( int32_t a ) ...@@ -537,7 +531,7 @@ static inline uint8_t clip_uint8_vlc( int32_t a )
VLC_USED VLC_USED
static inline unsigned (clz)(unsigned x) static inline unsigned (clz)(unsigned x)
{ {
#if VLC_GCC_VERSION(3,4) #ifdef __GNUC__
return __builtin_clz (x); return __builtin_clz (x);
#else #else
unsigned i = sizeof (x) * 8; unsigned i = sizeof (x) * 8;
...@@ -560,7 +554,7 @@ static inline unsigned (clz)(unsigned x) ...@@ -560,7 +554,7 @@ static inline unsigned (clz)(unsigned x)
VLC_USED VLC_USED
static inline unsigned (ctz)(unsigned x) static inline unsigned (ctz)(unsigned x)
{ {
#if VLC_GCC_VERSION(3,4) #ifdef __GNUC__
return __builtin_ctz (x); return __builtin_ctz (x);
#else #else
unsigned i = sizeof (x) * 8; unsigned i = sizeof (x) * 8;
...@@ -578,7 +572,7 @@ static inline unsigned (ctz)(unsigned x) ...@@ -578,7 +572,7 @@ static inline unsigned (ctz)(unsigned x)
VLC_USED VLC_USED
static inline unsigned (popcount)(unsigned x) static inline unsigned (popcount)(unsigned x)
{ {
#if VLC_GCC_VERSION(3,4) #ifdef __GNUC__
return __builtin_popcount (x); return __builtin_popcount (x);
#else #else
unsigned count = 0; unsigned count = 0;
...@@ -595,7 +589,7 @@ static inline unsigned (popcount)(unsigned x) ...@@ -595,7 +589,7 @@ static inline unsigned (popcount)(unsigned x)
VLC_USED VLC_USED
static inline int (popcountll)(unsigned long long x) static inline int (popcountll)(unsigned long long x)
{ {
#if VLC_GCC_VERSION(3,4) #ifdef __GNUC__
return __builtin_popcountll(x); return __builtin_popcountll(x);
#else #else
int count = 0; int count = 0;
...@@ -611,7 +605,7 @@ static inline int (popcountll)(unsigned long long x) ...@@ -611,7 +605,7 @@ static inline int (popcountll)(unsigned long long x)
VLC_USED VLC_USED
static inline unsigned (parity)(unsigned x) static inline unsigned (parity)(unsigned x)
{ {
#if VLC_GCC_VERSION(3,4) #ifdef __GNUC__
return __builtin_parity (x); return __builtin_parity (x);
#else #else
for (unsigned i = 4 * sizeof (x); i > 0; i /= 2) for (unsigned i = 4 * sizeof (x); i > 0; i /= 2)
...@@ -631,7 +625,7 @@ static inline uint16_t (bswap16)(uint16_t x) ...@@ -631,7 +625,7 @@ static inline uint16_t (bswap16)(uint16_t x)
VLC_USED VLC_USED
static inline uint32_t (bswap32)(uint32_t x) static inline uint32_t (bswap32)(uint32_t x)
{ {
#if VLC_GCC_VERSION(4,3) || defined(__clang__) #if defined (__GNUC__) || defined(__clang__)
return __builtin_bswap32 (x); return __builtin_bswap32 (x);
#else #else
return ((x & 0x000000FF) << 24) return ((x & 0x000000FF) << 24)
...@@ -645,7 +639,7 @@ static inline uint32_t (bswap32)(uint32_t x) ...@@ -645,7 +639,7 @@ static inline uint32_t (bswap32)(uint32_t x)
VLC_USED VLC_USED
static inline uint64_t (bswap64)(uint64_t x) static inline uint64_t (bswap64)(uint64_t x)
{ {
#if VLC_GCC_VERSION(4,3) || defined(__clang__) #if defined (__GNUC__) || defined(__clang__)
return __builtin_bswap64 (x); return __builtin_bswap64 (x);
#elif !defined (__cplusplus) #elif !defined (__cplusplus)
return ((x & 0x00000000000000FF) << 56) return ((x & 0x00000000000000FF) << 56)
......
...@@ -50,11 +50,7 @@ VLC_API unsigned vlc_CPU(void); ...@@ -50,11 +50,7 @@ VLC_API unsigned vlc_CPU(void);
# define VLC_MMX # define VLC_MMX
# else # else
# define vlc_CPU_MMX() ((vlc_CPU() & VLC_CPU_MMX) != 0) # define vlc_CPU_MMX() ((vlc_CPU() & VLC_CPU_MMX) != 0)
# if VLC_GCC_VERSION(4, 4) || defined(__clang__) # define VLC_MMX __attribute__ ((__target__ ("mmx")))
# define VLC_MMX __attribute__ ((__target__ ("mmx")))
# else
# define VLC_MMX VLC_MMX_is_not_implemented_on_this_compiler
# endif
# endif # endif
# if defined (__SSE__) # if defined (__SSE__)
...@@ -64,11 +60,7 @@ VLC_API unsigned vlc_CPU(void); ...@@ -64,11 +60,7 @@ VLC_API unsigned vlc_CPU(void);
# else # else
# define vlc_CPU_MMXEXT() ((vlc_CPU() & VLC_CPU_MMXEXT) != 0) # define vlc_CPU_MMXEXT() ((vlc_CPU() & VLC_CPU_MMXEXT) != 0)
# define vlc_CPU_SSE() ((vlc_CPU() & VLC_CPU_SSE) != 0) # define vlc_CPU_SSE() ((vlc_CPU() & VLC_CPU_SSE) != 0)
# if VLC_GCC_VERSION(4, 4) || defined(__clang__) # define VLC_SSE __attribute__ ((__target__ ("sse")))
# define VLC_SSE __attribute__ ((__target__ ("sse")))
# else
# define VLC_SSE VLC_SSE_is_not_implemented_on_this_compiler
# endif
# endif # endif
# ifdef __SSE2__ # ifdef __SSE2__
......
...@@ -221,7 +221,7 @@ enum vlc_module_properties ...@@ -221,7 +221,7 @@ enum vlc_module_properties
# define DLL_SYMBOL __declspec(dllexport) # define DLL_SYMBOL __declspec(dllexport)
# undef CDECL_SYMBOL # undef CDECL_SYMBOL
# define CDECL_SYMBOL __cdecl # define CDECL_SYMBOL __cdecl
# elif VLC_GCC_VERSION(4,0) # elif defined (__GNUC__)
# define DLL_SYMBOL __attribute__((visibility("default"))) # define DLL_SYMBOL __attribute__((visibility("default")))
# else # else
# define DLL_SYMBOL # define DLL_SYMBOL
......
...@@ -825,7 +825,7 @@ VLC_API void msleep(mtime_t delay); ...@@ -825,7 +825,7 @@ VLC_API void msleep(mtime_t delay);
#define VLC_HARD_MIN_SLEEP 10000 /* 10 milliseconds = 1 tick at 100Hz */ #define VLC_HARD_MIN_SLEEP 10000 /* 10 milliseconds = 1 tick at 100Hz */
#define VLC_SOFT_MIN_SLEEP 9000000 /* 9 seconds */ #define VLC_SOFT_MIN_SLEEP 9000000 /* 9 seconds */
#if VLC_GCC_VERSION(4,3) #ifdef __GNUC__
/* Linux has 100, 250, 300 or 1000Hz /* Linux has 100, 250, 300 or 1000Hz
* *
* HZ=100 by default on FreeBSD, but some architectures use a 1000Hz timer * HZ=100 by default on FreeBSD, but some architectures use a 1000Hz timer
......
...@@ -24,11 +24,7 @@ ...@@ -24,11 +24,7 @@
#if defined(__GNUC__) #if defined(__GNUC__)
# define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v # define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
# if VLC_GCC_VERSION(3,1) # define DECLARE_ASM_CONST(n,t,v) static const t __attribute__((used)) __attribute__ ((aligned (n))) v
# define DECLARE_ASM_CONST(n,t,v) static const t __attribute__((used)) __attribute__ ((aligned (n))) v
# else
# define DECLARE_ASM_CONST(n,t,v) static const t __attribute__ ((aligned (n))) v
# endif
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
# define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v # define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
#endif #endif
...@@ -41,7 +37,7 @@ DECLARE_ASM_CONST(16, xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010001000 ...@@ -41,7 +37,7 @@ DECLARE_ASM_CONST(16, xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010001000
#ifdef CAN_COMPILE_SSSE3 #ifdef CAN_COMPILE_SSSE3
#if defined(__SSE__) || VLC_GCC_VERSION(4, 4) || defined(__clang__) #if defined(__SSE__) || defined(__GNUC__) || defined(__clang__)
// ================ SSSE3 ================= // ================ SSSE3 =================
#define HAVE_YADIF_SSSE3 #define HAVE_YADIF_SSSE3
#define COMPILE_TEMPLATE_SSE 1 #define COMPILE_TEMPLATE_SSE 1
...@@ -57,7 +53,7 @@ DECLARE_ASM_CONST(16, xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010001000 ...@@ -57,7 +53,7 @@ DECLARE_ASM_CONST(16, xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010001000
#endif #endif
#ifdef CAN_COMPILE_SSE2 #ifdef CAN_COMPILE_SSE2
#if defined(__SSE__) || VLC_GCC_VERSION(4, 4) || defined(__clang__) #if defined(__SSE__) || defined(__GNUC__) || defined(__clang__)
// ================= SSE2 ================= // ================= SSE2 =================
#define HAVE_YADIF_SSE2 #define HAVE_YADIF_SSE2
#define COMPILE_TEMPLATE_SSE 1 #define COMPILE_TEMPLATE_SSE 1
...@@ -71,7 +67,7 @@ DECLARE_ASM_CONST(16, xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010001000 ...@@ -71,7 +67,7 @@ DECLARE_ASM_CONST(16, xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010001000
#endif #endif
#ifdef CAN_COMPILE_MMX #ifdef CAN_COMPILE_MMX
#if defined(__MMX__) || VLC_GCC_VERSION(4, 4) || defined(__clang__) #if defined(__MMX__) || defined(__GNUC__) || defined(__clang__)
// ================ MMX ================= // ================ MMX =================
#define HAVE_YADIF_MMX #define HAVE_YADIF_MMX
#define VLC_TARGET VLC_MMX #define VLC_TARGET VLC_MMX
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment