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

Re: Detecting kfreebsd kernel while compiling

Joachim Wiedorn <ad_debian@joonet.de> (29/01/2010):
> Compiling on systems with linux kernel runs fine - it seems "linux" is
> detected and the right code is used.
> For kfreebsd compiling I have added:
>   #ifdef kfreebsd
>   ..
> But on systems with kfreebsd kernel no code is used - not the "linux"
> code and not the "kfreebsd" code. Then I have tested it compiling with
> CFLAGS=-Dkfreebsd and it runs. 
> But is there a way for not hardcoding the kernel name ?

There's __FreeBSD__ for plain FreeBSD, and __FreeBSD_kernel__ for
GNU/kFreeBSD (which doesn't define the former, so that people can


Attachment: signature.asc
Description: Digital signature

Reply to: