diff options
author | Jose Fonseca <[email protected]> | 2016-04-18 12:08:35 +0100 |
---|---|---|
committer | Jose Fonseca <[email protected]> | 2016-04-26 17:17:00 +0100 |
commit | dcc3baf7331f7cb920a73e0349a7622bfe46f647 (patch) | |
tree | 5431ad05455a5252f2d37afc014d0c2454f6a9fd /src/gallium/auxiliary | |
parent | 9a25c8af1b7fad0e7b3f3f3b4cbf6ae6e32e0e4d (diff) |
gallium: Include intrin.h instead of defining ourselves.
More portable, particularly when building with Clang, which implements
all MSVC intrisincs in its own intrin.h, but doesn't actually support
`#pragma instrinsic`.
Reviewed-by: Roland Scheidegger <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/util/u_math.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index 10f158b7086..4e58e505572 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -50,6 +50,10 @@ #include <strings.h> /* for ffs */ #endif +#if defined(_MSC_VER) +#include <intrin.h> +#endif + #ifdef __cplusplus extern "C" { @@ -357,8 +361,6 @@ util_half_inf_sign(int16_t x) #define FFS_DEFINED 1 #if defined(_MSC_VER) && (_M_IX86 || _M_AMD64 || _M_IA64) -unsigned char _BitScanForward(unsigned long* Index, unsigned long Mask); -#pragma intrinsic(_BitScanForward) static inline unsigned long ffs( unsigned long u ) { |