This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
bad line in /usr/include/math.h
- To: cygwin at sourceware dot cygnus dot com
- Subject: bad line in /usr/include/math.h
- From: Issac Trotts <trotts at MIT dot EDU>
- Date: Thu, 20 Jul 2000 22:14:03 -0400
I got a very cryptic error message while compiling a C++ class library
called GiNaC (http://www.ginac.de/) that overloads the function log2
because of the following sinister line in /usr/include/math.h:
#define log2(x) (log(x) / M_LOG2_E)
I first tried to replace the line with inline versions of log2 for float
and double but
the compiler complained that log2 was being redefined. So I changed the line
to
#ifdef __cplusplus
// Do not define log2
#else
#define log2(x) (log(x) / M_LOG2_E)
#endif
and now the code compiles. Btw, I also put the following code:
#ifdef log2
#undef log2
#endif
above the line
unsigned log2(unsigned n);
in the GiNaC header file that originally had the problem, just in case
I get another infected math.h file later on.
-Issac
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com