Commit d3685de9 authored by Brad Smith's avatar Brad Smith Committed by Rafaël Carré

Fix building with Clang/LLVM

The following diff provides some fixes for VLC to allow building
with LLVM.
Signed-off-by: default avatarRafaël Carré <funman@videolan.org>
parent 08277ca2
...@@ -661,7 +661,7 @@ static inline uint16_t bswap16 (uint16_t x) ...@@ -661,7 +661,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) #if VLC_GCC_VERSION(4,3) || defined(__clang__)
return __builtin_bswap32 (x); return __builtin_bswap32 (x);
#else #else
return ((x & 0x000000FF) << 24) return ((x & 0x000000FF) << 24)
...@@ -675,7 +675,7 @@ static inline uint32_t bswap32 (uint32_t x) ...@@ -675,7 +675,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) #if VLC_GCC_VERSION(4,3) || defined(__clang__)
return __builtin_bswap64 (x); return __builtin_bswap64 (x);
#elif !defined (__cplusplus) #elif !defined (__cplusplus)
return ((x & 0x00000000000000FF) << 56) return ((x & 0x00000000000000FF) << 56)
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
# if defined (__MMX__) # if defined (__MMX__)
# define VLC_MMX # define VLC_MMX
# elif VLC_GCC_VERSION(4, 4) # elif VLC_GCC_VERSION(4, 4) || defined(__clang__)
# define VLC_MMX __attribute__ ((__target__ ("mmx"))) # define VLC_MMX __attribute__ ((__target__ ("mmx")))
# else # else
# define VLC_MMX VLC_MMX_is_not_implemented_on_this_compiler # define VLC_MMX VLC_MMX_is_not_implemented_on_this_compiler
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
# if defined (__SSE__) # if defined (__SSE__)
# define VLC_SSE # define VLC_SSE
# elif VLC_GCC_VERSION(4, 4) # elif VLC_GCC_VERSION(4, 4) || defined(__clang__)
# define VLC_SSE __attribute__ ((__target__ ("sse"))) # define VLC_SSE __attribute__ ((__target__ ("sse")))
# else # else
# define VLC_SSE VLC_SSE_is_not_implemented_on_this_compiler # define VLC_SSE VLC_SSE_is_not_implemented_on_this_compiler
......
...@@ -39,7 +39,7 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010 ...@@ -39,7 +39,7 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010
#ifdef CAN_COMPILE_SSSE3 #ifdef CAN_COMPILE_SSSE3
#if defined(__SSE__) || VLC_GCC_VERSION(4, 4) #if defined(__SSE__) || VLC_GCC_VERSION(4, 4) || defined(__clang__)
// ================ SSSE3 ================= // ================ SSSE3 =================
#define HAVE_YADIF_SSSE3 #define HAVE_YADIF_SSSE3
#define COMPILE_TEMPLATE_SSE 1 #define COMPILE_TEMPLATE_SSE 1
...@@ -55,7 +55,7 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010 ...@@ -55,7 +55,7 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010
#endif #endif
#ifdef CAN_COMPILE_SSE2 #ifdef CAN_COMPILE_SSE2
#if defined(__SSE__) || VLC_GCC_VERSION(4, 4) #if defined(__SSE__) || VLC_GCC_VERSION(4, 4) || defined(__clang__)
// ================= SSE2 ================= // ================= SSE2 =================
#define HAVE_YADIF_SSE2 #define HAVE_YADIF_SSE2
#define COMPILE_TEMPLATE_SSE 1 #define COMPILE_TEMPLATE_SSE 1
...@@ -69,7 +69,7 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010 ...@@ -69,7 +69,7 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010
#endif #endif
#ifdef CAN_COMPILE_MMX #ifdef CAN_COMPILE_MMX
#if defined(__MMX__) || VLC_GCC_VERSION(4, 4) #if defined(__MMX__) || VLC_GCC_VERSION(4, 4) || 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