From 3bf8c34d1fd2d6a064b1ddc333dd132c36b0e622 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 15 Jul 2014 08:11:57 -0400 Subject: [PATCH] Bug 1038492 - Cherry-pick libyuv's fix for clang-cl compatibility; r=jesup This imports the following upstream change: https://code.google.com/p/libyuv/source/detail?r=1033 --- media/libyuv/include/libyuv/row.h | 3 ++- media/libyuv/include/libyuv/video_common.h | 2 +- media/libyuv/source/cpu_id.cc | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/media/libyuv/include/libyuv/row.h b/media/libyuv/include/libyuv/row.h index 3e86f2807e48..0bd05daf0c11 100644 --- a/media/libyuv/include/libyuv/row.h +++ b/media/libyuv/include/libyuv/row.h @@ -38,7 +38,8 @@ extern "C" { var = 0 #if defined(__pnacl__) || defined(__CLR_VER) || defined(COVERAGE_ENABLED) || \ - defined(TARGET_IPHONE_SIMULATOR) + defined(TARGET_IPHONE_SIMULATOR) || \ + (defined(_MSC_VER) && defined(__clang__)) #define LIBYUV_DISABLE_X86 #endif // True if compiling for SSSE3 as a requirement. diff --git a/media/libyuv/include/libyuv/video_common.h b/media/libyuv/include/libyuv/video_common.h index 039efb96d1c1..91acc2ffcf92 100644 --- a/media/libyuv/include/libyuv/video_common.h +++ b/media/libyuv/include/libyuv/video_common.h @@ -115,7 +115,7 @@ enum FourCC { FOURCC_H264 = FOURCC('H', '2', '6', '4'), // Match any fourcc. - FOURCC_ANY = 0xFFFFFFFF, + FOURCC_ANY = -1, }; enum FourCCBpp { diff --git a/media/libyuv/source/cpu_id.cc b/media/libyuv/source/cpu_id.cc index dec3abf1b88a..ea2f6906f22e 100644 --- a/media/libyuv/source/cpu_id.cc +++ b/media/libyuv/source/cpu_id.cc @@ -10,7 +10,7 @@ #include "libyuv/cpu_id.h" -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) #include // For __cpuidex() #endif #if !defined(__pnacl__) && !defined(__CLR_VER) && \ @@ -48,7 +48,7 @@ extern "C" { defined(__i386__) || defined(__x86_64__)) LIBYUV_API void CpuId(uint32 info_eax, uint32 info_ecx, uint32* cpu_info) { -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !defined(__clang__) #if (_MSC_FULL_VER >= 160040219) __cpuidex((int*)(cpu_info), info_eax, info_ecx); #elif defined(_M_IX86)