This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] #undef __GLIBC__
On Tue, Nov 15, 2005 at 06:17:04PM +0000, Maciej W. Rozycki wrote:
> On Tue, 15 Nov 2005, Robert Millan wrote:
>
> > ITYM:
> >
> > #include <features.h>
> > #ifdef __GLIBC__
> >
> > The problem with this is, that you have no garantee <features.h> exists untill
> > you have identified the C library implementation somehow, so you can't include
> > it yet (chicken and egg).
>
> Then use <stdlib.h> -- it'd better exist everywhere.
There are a pair of corner cases:
- Programs for which the maintainers insist in supporting very broken systems
like, say, MS-DOG (portability for sane systems tends to suck a lot on such
programs).
- Programs that use cpp only for configuration of non-C stuff. For example
I've seen this before in X11 sources (both Xfree86 and X.org):
http://cvsweb.xfree86.org/cvsweb/xc/config/cf/Imake.cf?rev=3.91
http://necrotic.deadbeast.net/svn/xorg-x11/branches/6.9/xc/config/cf/Imake.cf
My conclussion is that trying to do system configuration using non-preprocessor
macros can be very awkward. I would like very much to avoid it (and preferably
have Glibc's consentment for that).
--
Robert Millan