Cygwin defines log2 as a macro. Undef it here IFF it has already been defined,
authorBrian Gaeke <gaeke@uiuc.edu>
Wed, 25 Feb 2004 01:53:45 +0000 (01:53 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Wed, 25 Feb 2004 01:53:45 +0000 (01:53 +0000)
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

include/Support/MathExtras.h
include/llvm/Support/MathExtras.h

index 125aff3b9ff255f10dce9441ef213403bbd43088..1540de3fcab090928439876006aadfbf6f410f65 100644 (file)
 
 namespace llvm {
 
+#if defined(log2)
+# undef log2
+#endif
+
 inline unsigned log2(uint64_t C) {
   unsigned getPow;
   for (getPow = 0; C > 1; ++getPow)
index 125aff3b9ff255f10dce9441ef213403bbd43088..1540de3fcab090928439876006aadfbf6f410f65 100644 (file)
 
 namespace llvm {
 
+#if defined(log2)
+# undef log2
+#endif
+
 inline unsigned log2(uint64_t C) {
   unsigned getPow;
   for (getPow = 0; C > 1; ++getPow)