[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Detecting kfreebsd kernel while compiling [hurd]



Hi,

Joachim Wiedorn <ad_debian@joonet.de> writes:

> Joachim Wiedorn <ad_debian@joonet.de> wrote:

[...]

> But now I see it is not so easy to test it on other architectures. Does
> some now how gcc give the string for 'hurd-i386' architectures? I have
> thought it should be simple:
>
>    __hurd__
>
> But it seems not.

On GNU systems (i.e., GNU/Hurd, GNU/kFreeBSD, GNU/Linux, etc.), the
GNU C library defines ‘__GLIBC__’.  GNU/Hurd (aka. GNU) additionally
defines ‘__GNU__’.

Again, it’s probably the case that your application wants to know about
the OS (“GNU”) but doesn’t have to worry about the underlying kernel
(“kFreeBSD”, etc.) since it may not be able to tell the difference.

Thanks,
Ludo’.


Reply to: