[llvm-commits] CVS: llvm/include/Support/MathExtras.h

Brian Gaeke gaeke at cs.uiuc.edu
Tue Feb 24 19:54:01 PST 2004


Changes in directory llvm/include/Support:

MathExtras.h updated: 1.10 -> 1.11

---
Log message:

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."



---
Diffs of the changes:  (+4 -0)

Index: llvm/include/Support/MathExtras.h
diff -u llvm/include/Support/MathExtras.h:1.10 llvm/include/Support/MathExtras.h:1.11
--- llvm/include/Support/MathExtras.h:1.10	Sun Nov 16 14:21:13 2003
+++ llvm/include/Support/MathExtras.h	Tue Feb 24 19:53:45 2004
@@ -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)





More information about the llvm-commits mailing list