Bug 1038492 - Cherry-pick libyuv's fix for clang-cl compatibility; r=jesup
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 15 Jul 2014 08:11:57 -0400
changeset 216081 23b67deeba5d41d01e17c5b0b6e3c11da46fda5a
parent 216080 3be3729d084edb29fe3bb9d712553f1e826044d2
child 216082 beb19278a0451e97ab214b033a7c37a70a1ad2b1
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1038492
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
media/libyuv/include/libyuv/video_common.h
media/libyuv/source/cpu_id.cc
--- a/media/libyuv/include/libyuv/row.h
+++ b/media/libyuv/include/libyuv/row.h
@@ -33,17 +33,18 @@ extern "C" {
   uint8* var = (uint8*)(((intptr_t)(var##_mem) + 63) & ~63)       /* NOLINT */
 #endif
 
 #define free_aligned_buffer_64(var) \
   free(var##_mem);  \
   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.
 #if defined(__SSSE3__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 3))
 #define LIBYUV_SSSE3_ONLY
 #endif
 
 // Enable for NaCL pepper 33 for bundle and AVX2 support.
--- a/media/libyuv/include/libyuv/video_common.h
+++ b/media/libyuv/include/libyuv/video_common.h
@@ -110,17 +110,17 @@ enum FourCC {
   FOURCC_L555 = FOURCC('L', '5', '5', '5'),  // Alias for RGBO.
   FOURCC_L565 = FOURCC('L', '5', '6', '5'),  // Alias for RGBP.
   FOURCC_5551 = FOURCC('5', '5', '5', '1'),  // Alias for RGBO.
 
   // 1 Auxiliary compressed YUV format set aside for capturer.
   FOURCC_H264 = FOURCC('H', '2', '6', '4'),
 
   // Match any fourcc.
-  FOURCC_ANY  = 0xFFFFFFFF,
+  FOURCC_ANY = -1,
 };
 
 enum FourCCBpp {
   // Canonical fourcc codes used in our code.
   FOURCC_BPP_I420 = 12,
   FOURCC_BPP_I422 = 16,
   FOURCC_BPP_I444 = 24,
   FOURCC_BPP_I411 = 12,
--- a/media/libyuv/source/cpu_id.cc
+++ b/media/libyuv/source/cpu_id.cc
@@ -5,17 +5,17 @@
  *  that can be found in the LICENSE file in the root of the source
  *  tree. An additional intellectual property rights grant can be found
  *  in the file PATENTS. All contributing project authors may
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
 #include "libyuv/cpu_id.h"
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && !defined(__clang__)
 #include <intrin.h>  // For __cpuidex()
 #endif
 #if !defined(__pnacl__) && !defined(__CLR_VER) && \
     !defined(__native_client__) && defined(_M_X64) && \
     defined(_MSC_VER) && (_MSC_FULL_VER >= 160040219)
 #include <immintrin.h>  // For _xgetbv()
 #endif
 
@@ -43,17 +43,17 @@ extern "C" {
 #endif
 
 // Low level cpuid for X86. Returns zeros on other CPUs.
 #if !defined(__pnacl__) && !defined(__CLR_VER) && \
     (defined(_M_IX86) || defined(_M_X64) || \
     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)
   __asm {
     mov        eax, info_eax
     mov        ecx, info_ecx
     mov        edi, cpu_info
     cpuid