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)
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)
# 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
# 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
#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
#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
#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