This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
Re: AIX atomicity.h support
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Subject: Re: AIX atomicity.h support
- From: David Edelsohn <dje at watson dot ibm dot com>
- Date: Fri, 06 Oct 2000 18:51:46 -0400
- cc: libstdc++ at sources dot redhat dot com, Mark Mitchell <mark at codesourcery dot com>, Geoff Keating <geoffk at cygnus dot com>, Phil Edwards <pedwards at disaster dot jaj dot com>
It's not just cdefs.h on AIX. It's also a number of files with
#ifndef _POSIX_SOURCE
# define _POSIX_SOURCE
#endif
namely filedoalloc.c, fileops.c, wfiledoalloc.c .
This construct assumes that if the _POSIX_SOURCE macro is going to
be defined, it will be defined on entry to the file, e.g. on the
commandline or by the compiler. This is not portable. libstdc++-v2/libio
at least moved repeated fragment to libioP.h, but does not seem to depend
on _POSIX_SOURCE=500 header definitions. libstdc++-v3 depends on more
than _POSIX_SOURCE=1.
libio seems to want to ensure that _POSIX_SOURCE is defined before
including the system headers, but does not allow for the headers
themselves to use magic to get the macro defined. By defining the macro
itself, it interferes with the system header magic.
I think that this needs to be done in a target-specific way
instead of trying to provide a default catch for platforms that may not
define _POSIX_SOURCE.
David