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

Re: __FreeBSD__ define



[Sorry if you get this twice, I didn't know if you were subscribed and I
wanted you to get this.]

On Wed, 2006-03-29 at 04:10 +0200, Peter Palfrader wrote:
> Hey,
> 
> one of my packages checks whether __FreeBSD__ is defined[1] and if that
> is the case i then avoids including machine/limits.h as this only causes
> noise on FreeBSD[0].
> 
> It seems the Debian/KFreeBSD port doesn't have __FreeBSD__ define.

That is correct.

> Is __FreeBSD__ only for the Real FreeBSD, and if yes, what should the
> code check for instead or in addition?

Yes, __FreeBSD__ is only for the Real Thing[0].  On GNU/kFreeBSD, we
have __FreeBSD_kernel__ instead.  This is because while we have the
FreeBSD kernel and everything that it includes (kernel, devices, syscall
sematics) we use glibc as a libc (and all the semantics that includes).
This means that we also have the glibc symbols.

To answer your question in this case, yes, GNU/kFreeBSD does the same
thing.  In fact, it has the same file.  So you could change:
#ifndef __FreeBSD__
to
#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
or something equivalent.

Thanks for asking; it's really nice to know there are DDs that care
about the port.


[0] Cue the Coca-Cola commercial.

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: