From 8fa02df3c0591754958a50cc2896aafae319f3bc Mon Sep 17 00:00:00 2001 From: Frank Barchard Date: Mon, 16 Oct 2017 17:32:42 -0700 Subject: [PATCH] mingw fix ifdefs to use gcc source mingw gcc sets the macro _M_IX86 which is normally only set by Visual C and clangcl which are Visual C style source code style for assembly, but gcc is not Visual C compatible. Add _MSC_VER to most ifdefs to detect that its really Visual C or clangcl and not mingw gcc so the gcc source code will be used. Bug: libyuv:744 Test: CXXFLAGS=-m32 CXX=~/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/bin/x86_64-w64-mingw32-g++ make -f linux.mk Change-Id: I3431aa486eb769b145faa8d5eb75ed639f9d6f5e Reviewed-on: https://chromium-review.googlesource.com/722319 Reviewed-by: Cheng Wang Commit-Queue: Frank Barchard --- README.chromium | 2 +- include/libyuv/rotate_row.h | 2 +- include/libyuv/version.h | 2 +- source/compare_win.cc | 2 +- source/rotate_win.cc | 2 +- source/scale_win.cc | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.chromium b/README.chromium index 5a5abef93..b78186a6a 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 1674 +Version: 1675 License: BSD License File: LICENSE diff --git a/include/libyuv/rotate_row.h b/include/libyuv/rotate_row.h index 2c51584ee..60ac55ef9 100644 --- a/include/libyuv/rotate_row.h +++ b/include/libyuv/rotate_row.h @@ -29,7 +29,7 @@ extern "C" { #endif #endif // The following are available for Visual C and clangcl 32 bit: -#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) +#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) #define HAS_TRANSPOSEWX8_SSSE3 #define HAS_TRANSPOSEUVWX8_SSE2 #endif diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 59f5a6d7f..9cb0c8c2c 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 1674 +#define LIBYUV_VERSION 1675 #endif // INCLUDE_LIBYUV_VERSION_H_ diff --git a/source/compare_win.cc b/source/compare_win.cc index 5ca59178d..0cf3f989c 100644 --- a/source/compare_win.cc +++ b/source/compare_win.cc @@ -23,7 +23,7 @@ extern "C" { #endif // This module is for 32 bit Visual C x86 and clangcl -#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) +#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) uint32 HammingDistance_X86(const uint8* src_a, const uint8* src_b, int count) { uint32 diff = 0u; diff --git a/source/rotate_win.cc b/source/rotate_win.cc index ee523a0b9..fb052f652 100644 --- a/source/rotate_win.cc +++ b/source/rotate_win.cc @@ -17,7 +17,7 @@ extern "C" { #endif // This module is for 32 bit Visual C x86 and clangcl -#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) +#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) __declspec(naked) void TransposeWx8_SSSE3(const uint8* src, int src_stride, diff --git a/source/scale_win.cc b/source/scale_win.cc index 3e9331283..b5fd66382 100644 --- a/source/scale_win.cc +++ b/source/scale_win.cc @@ -17,7 +17,7 @@ extern "C" { #endif // This module is for 32 bit Visual C x86 and clangcl -#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) +#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) // Offsets for source bytes 0 to 9 static uvec8 kShuf0 = {0, 1, 3, 4, 5, 7, 8, 9,