Merge "dsp: msvc compatibility"

This commit is contained in:
James Zern 2013-08-19 17:42:16 -07:00 committed by Gerrit Code Review
commit 4c7322c86f
2 changed files with 4 additions and 2 deletions

View File

@ -23,7 +23,8 @@ extern "C" {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// CPU detection // CPU detection
#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) #if defined(_MSC_VER) && _MSC_VER > 1310 && \
(defined(_M_X64) || defined(_M_IX86))
#define WEBP_MSC_SSE2 // Visual C++ SSE2 targets #define WEBP_MSC_SSE2 // Visual C++ SSE2 targets
#endif #endif

View File

@ -108,7 +108,8 @@ static WEBP_INLINE float VP8LFastSLog2(int v) {
static WEBP_INLINE int BitsLog2Floor(uint32_t n) { static WEBP_INLINE int BitsLog2Floor(uint32_t n) {
return 31 ^ __builtin_clz(n); return 31 ^ __builtin_clz(n);
} }
#elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) #elif defined(_MSC_VER) && _MSC_VER > 1310 && \
(defined(_M_X64) || defined(_M_IX86))
#include <intrin.h> #include <intrin.h>
#pragma intrinsic(_BitScanReverse) #pragma intrinsic(_BitScanReverse)