delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/07/20/22:15:19

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-Id: <200007210214.WAA19130@melbourne-city-street.MIT.EDU>
X-Sender: trotts AT hesiod (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0.2
Date: Thu, 20 Jul 2000 22:14:03 -0400
To: cygwin AT sourceware DOT cygnus DOT com
From: Issac Trotts <trotts AT MIT DOT EDU>
Subject: bad line in /usr/include/math.h
Mime-Version: 1.0

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 AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019