ref: be34c188a158264a20989f29420952e423af5fd9
parent: 0dc535ecbb836a8ebe338a0c67fc0b323d51aca7
parent: d89f861f4b7f8e351f065ac89b19a1803bd21922
author: James Zern <[email protected]>
date: Tue Feb 4 13:58:20 EST 2014
Merge "vp9_systemdependent.h: relocate system includes"
--- a/vp9/common/vp9_systemdependent.h
+++ b/vp9/common/vp9_systemdependent.h
@@ -11,15 +11,19 @@
#ifndef VP9_COMMON_VP9_SYSTEMDEPENDENT_H_
#define VP9_COMMON_VP9_SYSTEMDEPENDENT_H_
+#ifdef _MSC_VER
+# if _MSC_VER > 1310 && (defined(_M_X64) || defined(_M_IX86))
+# include <intrin.h>
+# define USE_MSC_INTRIN
+# endif
+# include <math.h>
+# define snprintf _snprintf
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
-#ifdef _MSC_VER
-#include <math.h>
-#define snprintf _snprintf
-#endif
-
#include "./vpx_config.h"
#if ARCH_X86 || ARCH_X86_64
void vpx_reset_mmx_state(void);
@@ -44,9 +48,7 @@
static INLINE int get_msb(unsigned int n) {
return 31 ^ __builtin_clz(n);
}
-#elif defined(_MSC_VER) && _MSC_VER > 1310 && \
- (defined(_M_X64) || defined(_M_IX86))
-#include <intrin.h>
+#elif defined(USE_MSC_INTRIN)
#pragma intrinsic(_BitScanReverse)
static INLINE int get_msb(unsigned int n) {
@@ -54,6 +56,7 @@
_BitScanReverse(&first_set_bit, n);
return first_set_bit;
}
+#undef USE_MSC_INTRIN
#else
// Returns (int)floor(log2(n)). n must be > 0.
static INLINE int get_msb(unsigned int n) {