diff --git a/include/libyuv/row.h b/include/libyuv/row.h index 6c5111a12..341666174 100644 --- a/include/libyuv/row.h +++ b/include/libyuv/row.h @@ -128,7 +128,7 @@ extern "C" { // The following are Windows only. // TODO(fbarchard): Port to gcc. -#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) +#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) #define HAS_ARGBCOLORTABLEROW_X86 // Visual C 2012 required for AVX2. #if _MSC_VER >= 1700 diff --git a/source/compare_win.cc b/source/compare_win.cc index 2bcab4ff8..e576e85c1 100644 --- a/source/compare_win.cc +++ b/source/compare_win.cc @@ -16,7 +16,7 @@ namespace libyuv { extern "C" { #endif -#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) +#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) __declspec(naked) __declspec(align(16)) uint32 SumSquareError_SSE2(const uint8* src_a, const uint8* src_b, int count) { @@ -184,7 +184,7 @@ uint32 HashDjb2_SSE41(const uint8* src, int count, uint32 seed) { ret } } -#endif // !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) +#endif // !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) #ifdef __cplusplus } // extern "C" diff --git a/source/cpu_id.cc b/source/cpu_id.cc index 8dea4d980..b4c993a27 100644 --- a/source/cpu_id.cc +++ b/source/cpu_id.cc @@ -74,7 +74,7 @@ void CpuId(int cpu_info[4], int) { static uint32 XGetBV(unsigned int xcr) { return static_cast(_xgetbv(xcr)); } -#elif !defined(__CLR_VER) && defined(_M_IX86) +#elif !defined(__CLR_VER) && defined(_M_IX86) && defined(_MSC_VER) #define HAS_XGETBV __declspec(naked) __declspec(align(16)) static uint32 XGetBV(unsigned int xcr) { diff --git a/source/rotate.cc b/source/rotate.cc index 1fe3c454e..c46650b44 100644 --- a/source/rotate.cc +++ b/source/rotate.cc @@ -72,7 +72,7 @@ void TransposeUVWx8_MIPS_DSPR2(const uint8* src, int src_stride, int width); #endif // defined(__mips__) -#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) +#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) #define HAS_TRANSPOSE_WX8_SSSE3 __declspec(naked) __declspec(align(16)) static void TransposeWx8_SSSE3(const uint8* src, int src_stride, diff --git a/source/row_win.cc b/source/row_win.cc index 6dc84c4ad..4ea06923d 100644 --- a/source/row_win.cc +++ b/source/row_win.cc @@ -16,7 +16,7 @@ extern "C" { #endif // This module is for Visual C x86. -#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) +#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) #ifdef HAS_ARGBTOYROW_SSSE3 @@ -6602,8 +6602,7 @@ void I422ToUYVYRow_SSE2(const uint8* src_y, ret } } - -#endif // _M_IX86 +#endif // !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) #ifdef __cplusplus } // extern "C" diff --git a/source/scale.cc b/source/scale.cc index 5d28e5eef..77af420b3 100644 --- a/source/scale.cc +++ b/source/scale.cc @@ -179,7 +179,7 @@ CONST uvec16 kScaleAb2 = { 65536 / 3, 65536 / 3, 65536 / 2, 65536 / 3, 65536 / 3, 65536 / 2, 0, 0 }; #endif -#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) +#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) #define HAS_SCALEROWDOWN2_SSE2 // Reads 32 pixels, throws half away and writes 16 pixels. // Alignment requirement: src_ptr 16 byte aligned, dst_ptr 16 byte aligned. diff --git a/source/scale_argb.cc b/source/scale_argb.cc index 46fefcee8..5cf14d949 100644 --- a/source/scale_argb.cc +++ b/source/scale_argb.cc @@ -43,7 +43,7 @@ void ScaleARGBRowDown2Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride, uint8* dst, int dst_width); #endif -#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) +#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) #define HAS_SCALEARGBROWDOWN2_SSE2 // Reads 8 pixels, throws half away and writes 4 even pixels (0, 2, 4, 6) // Alignment requirement: src_argb 16 byte aligned, dst_argb 16 byte aligned. @@ -814,7 +814,7 @@ static void ScaleARGBDownEven(int src_width, int src_height, } } -// ScaleARGB ARGB to/from any dimensions, with bilinear interpolation. +// Scale ARGB down with bilinear interpolation. static void ScaleARGBBilinearDown(int src_height, int dst_width, int dst_height, int src_stride, int dst_stride, @@ -898,7 +898,7 @@ static void ScaleARGBBilinearDown(int src_height, } } -// ScaleARGB ARGB to/from any dimensions, with bilinear interpolation. +// Scale ARGB up with bilinear interpolation. static void ScaleARGBBilinearUp(int src_width, int src_height, int dst_width, int dst_height, int src_stride, int dst_stride, diff --git a/util/psnr.cc b/util/psnr.cc index 85ada628b..8799d6af6 100644 --- a/util/psnr.cc +++ b/util/psnr.cc @@ -79,7 +79,7 @@ static uint32 SumSquareError_NEON(const uint8* src_a, : "memory", "cc", "q0", "q1", "q2", "q3", "q7", "q8", "q9", "q10"); return sse; } -#elif !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) +#elif !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) #define HAS_SUMSQUAREERROR_SSE2 __declspec(naked) static uint32 SumSquareError_SSE2(const uint8* /*src_a*/,