[vlc-commits] Remove ifdefs for GCC version below 4.4

Rémi Denis-Courmont git at videolan.org
Sat Feb 25 14:59:19 CET 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb 25 15:37:38 2017 +0200| [97d669a8c704a19f9bd4cd4b8f995dcc9e9edbb7] | committer: Rémi Denis-Courmont

Remove ifdefs for GCC version below 4.4

According to INSTALL, we require GCC 4.8 already.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=97d669a8c704a19f9bd4cd4b8f995dcc9e9edbb7
---

 include/vlc_common.h                     | 28 +++++++++++-----------------
 include/vlc_cpu.h                        | 12 ++----------
 include/vlc_plugin.h                     |  2 +-
 include/vlc_threads.h                    |  2 +-
 modules/video_filter/deinterlace/yadif.h | 12 ++++--------
 5 files changed, 19 insertions(+), 37 deletions(-)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index db5e6da..6a75753 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -84,20 +84,14 @@
 #ifdef __GNUC__
 # 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)))
 # else
 #  define VLC_FORMAT(x,y) __attribute__ ((format(printf,x,y)))
 # endif
 # define VLC_FORMAT_ARG(x) __attribute__ ((format_arg(x)))
-
 # define VLC_MALLOC __attribute__ ((malloc))
-
-# if VLC_GCC_VERSION(3,4)
-#  define VLC_USED __attribute__ ((warn_unused_result))
-# else
-#  define VLC_USED
-# endif
+# define VLC_USED __attribute__ ((warn_unused_result))
 
 #else
 # define VLC_DEPRECATED
@@ -130,7 +124,7 @@
 
 #if defined (_WIN32) && defined (DLL_EXPORT)
 # define VLC_EXPORT __declspec(dllexport)
-#elif VLC_GCC_VERSION(4,0)
+#elif defined (__GNUC__)
 # define VLC_EXPORT __attribute__((visibility("default")))
 #else
 # define VLC_EXPORT
@@ -477,7 +471,7 @@ struct vlc_common_members
         struct vlc_common_members: (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
 #  define VLC_OBJECT( x ) \
     __builtin_choose_expr( \
@@ -537,7 +531,7 @@ static inline uint8_t clip_uint8_vlc( int32_t a )
 VLC_USED
 static inline unsigned (clz)(unsigned x)
 {
-#if VLC_GCC_VERSION(3,4)
+#ifdef __GNUC__
     return __builtin_clz (x);
 #else
     unsigned i = sizeof (x) * 8;
@@ -560,7 +554,7 @@ static inline unsigned (clz)(unsigned x)
 VLC_USED
 static inline unsigned (ctz)(unsigned x)
 {
-#if VLC_GCC_VERSION(3,4)
+#ifdef __GNUC__
     return __builtin_ctz (x);
 #else
     unsigned i = sizeof (x) * 8;
@@ -578,7 +572,7 @@ static inline unsigned (ctz)(unsigned x)
 VLC_USED
 static inline unsigned (popcount)(unsigned x)
 {
-#if VLC_GCC_VERSION(3,4)
+#ifdef __GNUC__
     return __builtin_popcount (x);
 #else
     unsigned count = 0;
@@ -595,7 +589,7 @@ static inline unsigned (popcount)(unsigned x)
 VLC_USED
 static inline int (popcountll)(unsigned long long x)
 {
-#if VLC_GCC_VERSION(3,4)
+#ifdef __GNUC__
     return __builtin_popcountll(x);
 #else
     int count = 0;
@@ -611,7 +605,7 @@ static inline int (popcountll)(unsigned long long x)
 VLC_USED
 static inline unsigned (parity)(unsigned x)
 {
-#if VLC_GCC_VERSION(3,4)
+#ifdef __GNUC__
     return __builtin_parity (x);
 #else
     for (unsigned i = 4 * sizeof (x); i > 0; i /= 2)
@@ -631,7 +625,7 @@ static inline uint16_t (bswap16)(uint16_t x)
 VLC_USED
 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);
 #else
     return ((x & 0x000000FF) << 24)
@@ -645,7 +639,7 @@ static inline uint32_t (bswap32)(uint32_t x)
 VLC_USED
 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);
 #elif !defined (__cplusplus)
     return ((x & 0x00000000000000FF) << 56)
diff --git a/include/vlc_cpu.h b/include/vlc_cpu.h
index 8c520a0..b2f0f45 100644
--- a/include/vlc_cpu.h
+++ b/include/vlc_cpu.h
@@ -50,11 +50,7 @@ VLC_API unsigned vlc_CPU(void);
 #  define VLC_MMX
 # else
 #  define vlc_CPU_MMX() ((vlc_CPU() & VLC_CPU_MMX) != 0)
-#  if VLC_GCC_VERSION(4, 4) || defined(__clang__)
-#   define VLC_MMX __attribute__ ((__target__ ("mmx")))
-#  else
-#   define VLC_MMX VLC_MMX_is_not_implemented_on_this_compiler
-#  endif
+#  define VLC_MMX __attribute__ ((__target__ ("mmx")))
 # endif
 
 # if defined (__SSE__)
@@ -64,11 +60,7 @@ VLC_API unsigned vlc_CPU(void);
 # else
 #  define vlc_CPU_MMXEXT() ((vlc_CPU() & VLC_CPU_MMXEXT) != 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")))
-#  else
-#   define VLC_SSE VLC_SSE_is_not_implemented_on_this_compiler
-#  endif
+#  define VLC_SSE __attribute__ ((__target__ ("sse")))
 # endif
 
 # ifdef __SSE2__
diff --git a/include/vlc_plugin.h b/include/vlc_plugin.h
index 2f2405f..39a9e0b 100644
--- a/include/vlc_plugin.h
+++ b/include/vlc_plugin.h
@@ -221,7 +221,7 @@ enum vlc_module_properties
 #   define DLL_SYMBOL              __declspec(dllexport)
 #   undef CDECL_SYMBOL
 #   define CDECL_SYMBOL            __cdecl
-# elif VLC_GCC_VERSION(4,0)
+# elif defined (__GNUC__)
 #   define DLL_SYMBOL              __attribute__((visibility("default")))
 # else
 #  define DLL_SYMBOL
diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index 9ef4e3e..1ee346c 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -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_SOFT_MIN_SLEEP 9000000 /* 9 seconds */
 
-#if VLC_GCC_VERSION(4,3)
+#ifdef __GNUC__
 /* Linux has 100, 250, 300 or 1000Hz
  *
  * HZ=100 by default on FreeBSD, but some architectures use a 1000Hz timer
diff --git a/modules/video_filter/deinterlace/yadif.h b/modules/video_filter/deinterlace/yadif.h
index 05e5492..4704809 100644
--- a/modules/video_filter/deinterlace/yadif.h
+++ b/modules/video_filter/deinterlace/yadif.h
@@ -24,11 +24,7 @@
 
 #if defined(__GNUC__)
 #  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
-#  else
-#    define DECLARE_ASM_CONST(n,t,v)    static const t __attribute__ ((aligned (n))) v
-#  endif
+#  define DECLARE_ASM_CONST(n,t,v)    static const t __attribute__((used)) __attribute__ ((aligned (n))) v
 #elif defined(_MSC_VER)
 #    define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v
 #endif
@@ -41,7 +37,7 @@ DECLARE_ASM_CONST(16, xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010001000
 
 
 #ifdef CAN_COMPILE_SSSE3
-#if defined(__SSE__) || VLC_GCC_VERSION(4, 4) || defined(__clang__)
+#if defined(__SSE__) || defined(__GNUC__) || defined(__clang__)
 // ================ SSSE3 =================
 #define HAVE_YADIF_SSSE3
 #define COMPILE_TEMPLATE_SSE 1
@@ -57,7 +53,7 @@ DECLARE_ASM_CONST(16, xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010001000
 #endif
 
 #ifdef CAN_COMPILE_SSE2
-#if defined(__SSE__) || VLC_GCC_VERSION(4, 4) || defined(__clang__)
+#if defined(__SSE__) || defined(__GNUC__) || defined(__clang__)
 // ================= SSE2 =================
 #define HAVE_YADIF_SSE2
 #define COMPILE_TEMPLATE_SSE 1
@@ -71,7 +67,7 @@ DECLARE_ASM_CONST(16, xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010001000
 #endif
 
 #ifdef CAN_COMPILE_MMX
-#if defined(__MMX__) || VLC_GCC_VERSION(4, 4) || defined(__clang__)
+#if defined(__MMX__) || defined(__GNUC__) || defined(__clang__)
 // ================ MMX =================
 #define HAVE_YADIF_MMX
 #define VLC_TARGET VLC_MMX



More information about the vlc-commits mailing list