Cygwin defines log2 as a macro. Undef it here IFF it has already been defined,

so that we always get the inline function instead. Remember, kids, like it says
in the GCC manual, "An Inline Function is As Fast As a Macro."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11815 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Brian Gaeke 2004-02-25 01:53:45 +00:00
parent 2051fe3df5
commit bb92f6fbf2
2 changed files with 8 additions and 0 deletions

View File

@ -18,6 +18,10 @@
namespace llvm {
#if defined(log2)
# undef log2
#endif
inline unsigned log2(uint64_t C) {
unsigned getPow;
for (getPow = 0; C > 1; ++getPow)

View File

@ -18,6 +18,10 @@
namespace llvm {
#if defined(log2)
# undef log2
#endif
inline unsigned log2(uint64_t C) {
unsigned getPow;
for (getPow = 0; C > 1; ++getPow)