From df90670aa5eb8927d156b2c89cd3e13a3bbbe059 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Mon, 16 Mar 2015 19:56:41 +0000 Subject: [PATCH] clangcl build fix for __cpuid in psnr util. Since clangcl provides the intrinsic thru its Visual C emulation, don't duplicately define the function with an inline version, which is normally needed for gcc/clang. BUG=412 TESTED=set GYP_DEFINES=clang=1 & gyp_libyuv -fninja libyuv_test.gyp R=brucedawson@google.com Review URL: https://webrtc-codereview.appspot.com/40339004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@1331 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- util/psnr.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/psnr.cc b/util/psnr.cc index 127bf9f0d..fbcb4e453 100644 --- a/util/psnr.cc +++ b/util/psnr.cc @@ -206,7 +206,8 @@ static __inline void __cpuid(int cpu_info[4], int info_type) { : "=a"(cpu_info[0]), "=D"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3]) : "a"(info_type)); } -#elif defined(__i386__) || defined(__x86_64__) +// For gcc/clang but not clangcl. +#elif (defined(__i386__) || defined(__x86_64__)) && !defined(_MSC_VER) static __inline void __cpuid(int cpu_info[4], int info_type) { asm volatile ( // NOLINT "cpuid \n"