[PATCH] __FreeBSD_kernel__

Garrett Cooper yanegomi at gmail.com
Wed Jul 6 07:00:21 UTC 2011


On Tue, Jul 5, 2011 at 11:53 PM, Robert Millan <rmh at debian.org> wrote:
> 2011/7/5 Ed Maste <emaste at freebsd.org>:
>> On the topic of where such a macro should be defined I originally had
>> no strong opinion.  However, valid points have been raised about
>> compiling software for FreeBSD using compilers that are not the one in
>> the base system (from ports or otherwise, and GCC or otherwise).  This
>> I think is a very valid point and one that would make me lean towards
>> defining the macro in sys/param.h.  How workable is it to #include
>> sys/param.h to pick up the macro where needed?
>
> That works most of the time.  There could be a problem if software
> can't assume <sys/param.h> is present, but I think it covers the vast
> majority of cases.

Speaking from my limited experience trying to fix net-snmp's autoconf
tests over the past couple of days and maintaining LTP, as well as
development in general on FreeBSD and Linux platforms, I think that
more of an issue lays in socializing the development structure of
FreeBSD to third-parties, in particular because a number of groups
fail to adhere to some of the practices that have been explicitly or
implicitly put forth by FreeBSD in terms of headers and definitions.

Granted, this is one piece of the puzzle, but it's an important one,
because the following (for example):

$ cat foo.c
#include <sys/types.h>
#include <netinet/in.h>
#include <netinet/in_pcb.h>
#include <sys/param.h>
#include <stdio.h>

... isn't guaranteed to work :).

Thanks,
-Garrett


More information about the freebsd-hackers mailing list