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 02:59:18PM +0000, Mike Frysinger wrote:
> > Now you'll say that __linux__ should only be used for kernel checks (and I
> > agree), but we have to adhere to the facts, which are that because there's no
> > other way to check for Glibc using pre-processor only, lots of programs use
> > __linux__ instead.
>
> as you hint at, those programs are broken. if they want linux, then
> they should use __linux__. if they want glibc, then they should include
> features.h and use __GLIBC__.
> [...]
> why not change it to
> #include <features.h>
> #if defined(__linux__) || defined(__GLIBC__) || defined(__GNU__)
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).
> i dont know how you're handling the
> FreeBSD/glibc porting effort, but if it's typical BSD fashion, you
> should try sending patches to upstream maintainers instead of keeping
> them all local. people like patches ;)
Although GNU/kFreeBSD aims to be a generic system like GNU/Linux, as of now it's
basicaly just a sub-project inside Debian:
http://www.debian.org/ports/kfreebsd-gnu
We always try to merge patches in upstream, but because of the amount of patches
(see http://glibc-bsd.alioth.debian.org/patches/), and our limited time, this is
not always possible. Help in that area is welcome of course ;).
--
Robert Millan