Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: C99/C++ patch for /usr/include/math.h Date: Sat, 5 Jul 2003 09:59:36 +1000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Billinghurst, David (CRTS)" To: Cc: X-OriginalArrivalTime: 04 Jul 2003 23:56:33.0487 (UTC) FILETIME=[E57F9DF0:01C34287] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id h65008728203 I have been working through some gcc-3.4 libstdc++-v3 testsuite failures on cygwin. The tests: - 26_numerics/c99_classification_macros_c++.cc - 26_numerics/c99_classification_macros_c.cc fail because C99 and C++ disagree over fpclassify() The following patch to /usr/include/math.h does the job, but I haven't checked it against the standards. I don't have a newlib tree at present, so I am unsure which source file needs the patch. Tested by successful compilation of above tests. 2003-07-05 David Billinghurst * math.h: Do not define ISO C99 types and macros for C++ --- math.h.orig 2003-07-05 09:10:07.000000000 +1000 +++ math.h 2003-07-05 09:23:25.000000000 +1000 @@ -63,9 +63,8 @@ #endif /* ! defined (__math_68881) */ #endif /* ! defined (_REENT_ONLY) */ -#ifndef __STRICT_ANSI__ - /* ISO C99 types and macros. */ +#if ! defined (__STRICT_ANSI__) && ! defined (__cplusplus) #ifndef FLT_EVAL_METHOD #define FLT_EVAL_METHOD 0 @@ -116,8 +115,10 @@ (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ fpclassify(__x) == FP_NAN || fpclassify(__y) == FP_NAN;})) -/* Non ANSI double precision functions. */ +#endif /* ! defined (__STRICT_ANSI__) && ! defined (__cplusplus) */ +/* Non ANSI double precision functions. */ +#ifndef __STRICT_ANSI__ extern double infinity _PARAMS((void)); extern double nan _PARAMS((void)); extern int isnan _PARAMS((double)); -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/