MATH: Just look for a GCC compatible compiler for __builtin_clz()
There's no need to check for GCC 3.4+ anymore, since we always require a C++11 compiler. Just look for __GNUC__, since this is an old builtin and Clang always has it too. Also #undef the LT() temporary macro while there, so that it can't pollute something else by accident, since it's a short macro name in a header file.
This commit is contained in:
parent
5ebd9b8d23
commit
4ac33a72c2
1 changed files with 2 additions and 1 deletions
|
@ -66,7 +66,7 @@ struct Complex {
|
|||
float re, im;
|
||||
};
|
||||
|
||||
#if GCC_ATLEAST(3, 4)
|
||||
#if defined(__GNUC__)
|
||||
inline int intLog2(uint32 v) {
|
||||
// This is a slightly optimized implementation of log2 for natural numbers
|
||||
// targeting gcc. It also saves some binary size over our fallback
|
||||
|
@ -94,6 +94,7 @@ static const char LogTable256[256] = {
|
|||
-1, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
LT(4), LT(5), LT(5), LT(6), LT(6), LT(6), LT(6),
|
||||
LT(7), LT(7), LT(7), LT(7), LT(7), LT(7), LT(7), LT(7)
|
||||
#undef LT
|
||||
};
|
||||
|
||||
inline int intLog2(uint32 v) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue