aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-02-25 01:53:45 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-02-25 01:53:45 +0000
commitbb92f6fbf2c36b3530f33eb2e8d1842764ec9fdd (patch)
tree5847c9a3081c2d60e20aa547370b0eb25750ed35 /include
parent2051fe3df52d385daa56ce69765ef172386e5927 (diff)
downloadexternal_llvm-bb92f6fbf2c36b3530f33eb2e8d1842764ec9fdd.zip
external_llvm-bb92f6fbf2c36b3530f33eb2e8d1842764ec9fdd.tar.gz
external_llvm-bb92f6fbf2c36b3530f33eb2e8d1842764ec9fdd.tar.bz2
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
Diffstat (limited to 'include')
-rw-r--r--include/Support/MathExtras.h4
-rw-r--r--include/llvm/Support/MathExtras.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/include/Support/MathExtras.h b/include/Support/MathExtras.h
index 125aff3..1540de3 100644
--- a/include/Support/MathExtras.h
+++ b/include/Support/MathExtras.h
@@ -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)
diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h
index 125aff3..1540de3 100644
--- a/include/llvm/Support/MathExtras.h
+++ b/include/llvm/Support/MathExtras.h
@@ -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)