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 Message-ID: <3F09C2AC.5020001@redhat.com> Date: Mon, 07 Jul 2003 14:57:48 -0400 From: "J. Johnston" Organization: Red Hat Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Billinghurst, David (CRTS)" Cc: cygwin AT cygwin DOT com, newlib AT sources DOT redhat DOT com Subject: Re: C99/C++ patch for /usr/include/math.h References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit David, Could you provide more details on the failure. Does the latest version of the testcases test long double by any chance? The newlib version matches the C99 sample definition except that it is missing long double support. -- Jeff J. Billinghurst, David (CRTS) wrote: > 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/