]> git.sesse.net Git - vlc/commitdiff
Fix building with Clang/LLVM
authorBrad Smith <brad@comstyle.com>
Thu, 3 Jan 2013 05:03:52 +0000 (00:03 -0500)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 7 Jan 2013 10:32:39 +0000 (11:32 +0100)
The following diff provides some fixes for VLC to allow building
with LLVM.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
include/vlc_common.h
include/vlc_cpu.h
modules/video_filter/deinterlace/yadif.h

index 1ef288cfe001e4c8f3f1b2c896a03b77c2585c80..b10ae6eea63d8bb6b036e575190a5563f978b9ac 100644 (file)
@@ -582,7 +582,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)
+#if VLC_GCC_VERSION(4,3) || defined(__clang__)
     return __builtin_bswap32 (x);
 #else
     return ((x & 0x000000FF) << 24)
@@ -596,7 +596,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)
+#if VLC_GCC_VERSION(4,3) || defined(__clang__)
     return __builtin_bswap64 (x);
 #elif !defined (__cplusplus)
     return ((x & 0x00000000000000FF) << 56)
index 0a9d6e85e963a9717da7dba544ae9d96f9a3ff83..611121cb32be3c8ad5436e2b4d95287dc85098a8 100644 (file)
@@ -50,7 +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)
+#  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
@@ -64,7 +64,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)
+#  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
index 3c4bbab4d0917eac012b366b7801f24d7a3175c7..219b7a408287653cb787703ffee70f839610c60a 100644 (file)
@@ -39,7 +39,7 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010
 
 
 #ifdef CAN_COMPILE_SSSE3
-#if defined(__SSE__) || VLC_GCC_VERSION(4, 4)
+#if defined(__SSE__) || VLC_GCC_VERSION(4, 4) || defined(__clang__)
 // ================ SSSE3 =================
 #define HAVE_YADIF_SSSE3
 #define COMPILE_TEMPLATE_SSE 1
@@ -55,7 +55,7 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010
 #endif
 
 #ifdef CAN_COMPILE_SSE2
-#if defined(__SSE__) || VLC_GCC_VERSION(4, 4)
+#if defined(__SSE__) || VLC_GCC_VERSION(4, 4) || defined(__clang__)
 // ================= SSE2 =================
 #define HAVE_YADIF_SSE2
 #define COMPILE_TEMPLATE_SSE 1
@@ -69,7 +69,7 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010
 #endif
 
 #ifdef CAN_COMPILE_MMX
-#if defined(__MMX__) || VLC_GCC_VERSION(4, 4)
+#if defined(__MMX__) || VLC_GCC_VERSION(4, 4) || defined(__clang__)
 // ================ MMX =================
 #define HAVE_YADIF_MMX
 #define VLC_TARGET VLC_MMX