# HG changeset patch
# User William Stein <wstein@gmail.com>
# Date 1211060708 28800
# Node ID e76bcf72ff8b14f417205ad5b5fe00d7c9f37f2b
# Parent  2d65f1dafd02073931b4a361eaf49f0afdc024c3
Wrap log2 in a function so it will work in cygwin.  In cygwin log2 is a macro:

sh-3.2$ grep log2 *.h
math.h:#define log2(x) (log (x) / M_LOG2_E)
math.h:#define log2f(x) (logf (x) / (float) M_LOG2_E)

diff -r 2d65f1dafd02 -r e76bcf72ff8b sage/ext/fast_eval.pyx
--- a/sage/ext/fast_eval.pyx	Sat May 17 12:25:31 2008 -0800
+++ b/sage/ext/fast_eval.pyx	Sat May 17 13:45:08 2008 -0800
@@ -109,8 +109,14 @@ cdef extern from "math.h":
     
     double exp(double)
     double log(double)
-    double log2(double)
     double log10(double)
+    double log2_ "log2"(double)
+
+
+# This is only needed on Cygwin since log2 is a macro.
+# If we don't do this the cygwin GCC gets very confused.
+cdef inline double log2(double x): 
+    return log2_(x)
 
 cdef extern from *:
     void* memcpy(void* dst, void* src, size_t len)
