This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] define M_PI etc. if _XOPEN_SOURCE is defined appropriately


On 30/07/2014 15:19, Corinna Vinschen wrote:
On Jul 30 15:12, Jon TURNEY wrote:
On 30/07/2014 14:54, Jon TURNEY wrote:
math.h only defines M_PI and similar constants if __STRICT_ANSI__ is not
defined.

SUSv2 specifies that math.h should define some of these constants [1].

Attached is a patch to also define these constants if _XOPEN_SOURCE is
defined appropriately.

So bad :-(

This patch doesn't correctly handle the case where _XOPEN_SOURCE is defined
as the empty string.  Amended patch attached.

You can workaround that by using the definition of __XSI_VISIBLE
from <sys/cdefs.h>.  It's always defined and non-empty.

Yes, that seems a much better way of doing things.

However, in my testing, __XSI_VISIBLE seems to be defined by line 704 in cdefs.h with just -std=c99, which doesn't seem right.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]