freebsd has _null.h (and so does bitrig)

that file's only purpose is to define NULL which i presume is the same
as netbsd's null.h

i think it's better than having tons of duplicate NULL definitions in
the headers...

(jmc@ pointed out to me in private more or less the same issue with my
suggestion but i figured i'd wait until i produced a patch for _null.h
in openbsd)

On Sat, Mar 30, 2013 at 3:33 AM, Otto Moerbeek <o...@drijf.net> wrote:
> On Mon, Mar 18, 2013 at 03:31:29PM -0430, Andres Perera wrote:
>
>> Various macros in <sys/queue.h> depend on NULL; however, the header
>> does not define NULL, nor does it include another header that fulfills the 
>> dependency.
>>
>> diff --git a/share/man/man3/queue.3 b/share/man/man3/queue.3
>> index c54e932..5a2e30c 100644
>> --- a/share/man/man3/queue.3
>> +++ b/share/man/man3/queue.3
>> @@ -120,6 +120,7 @@
>>  .Nm CIRCLEQ_REPLACE
>>  .Nd "implementations of singly-linked lists, doubly-linked lists, simple 
>> queues, tail queues, and circular queues"
>>  .Sh SYNOPSIS
>> +.Fd #include <sys/types.h>
>>  .Fd #include <sys/queue.h>
>>  .Pp
>>  .Fn SLIST_ENTRY "TYPE"
>
> This is harder that is seems at first sight. <sys/types.h> does not
> define NULL in all cases. i.e. if __BSD_VISIBLE is not defined, this
> won't wont work. So depending on things like _ANSI_SOURCE and
> __POSIX_VISIBLE you still don't get NULL.
>
> netbsd has solved it by creating an ugly include <sys/null.h>, freebsd
> did not solve it either, afaiks. A local NULL define could do it. Will have
> to think about this a bit.
>
>         -Otto

Reply via email to