Remove checking macros __OPTIMIZE__ for MSVC

Visual C++ compiler doesn't define macros __OPTIMIZE__  when optimizations enabled
This commit is contained in:
Arkady Shapkin 2018-02-16 21:45:08 +03:00 committed by Behdad Esfahbod
parent 4eff0fc5b8
commit d37310ac5d
1 changed files with 4 additions and 5 deletions

View File

@ -355,7 +355,7 @@ _hb_bit_storage (unsigned int number)
{ {
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__) #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__)
return likely (number) ? (sizeof (unsigned int) * 8 - __builtin_clz (number)) : 0; return likely (number) ? (sizeof (unsigned int) * 8 - __builtin_clz (number)) : 0;
#elif defined(_MSC_VER) && defined(__OPTIMIZE__) #elif defined(_MSC_VER)
unsigned long where; unsigned long where;
if (_BitScanReverse (&where, number)) return 1 + where; if (_BitScanReverse (&where, number)) return 1 + where;
return 0; return 0;
@ -375,11 +375,10 @@ _hb_ctz (unsigned int number)
{ {
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__) #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__)
return likely (number) ? __builtin_ctz (number) : 0; return likely (number) ? __builtin_ctz (number) : 0;
#elif defined(_MSC_VER) && defined(__OPTIMIZE__) #elif defined(_MSC_VER)
unsigned long where; unsigned long where;
if (_BitScanForward(&where, n)) return where; if (_BitScanForward (&where, number)) return where;
return 0; return 0;
}
#else #else
unsigned int n_bits = 0; unsigned int n_bits = 0;
if (unlikely (!number)) return 0; if (unlikely (!number)) return 0;