From 4a8002bb72c6f3a0455061f2eefe3f72d5db5937 Mon Sep 17 00:00:00 2001 From: pooka Date: Wed, 17 Jul 2013 15:50:59 +0000 Subject: [PATCH] Include sys/null.h only on NetBSD because sys/null.h is not available elsewhere. This conditional makes the header portable and it can simply be dropped verbatim into any system. Also, move the inclusion below the comment block describing the purpose of queue.h so that people looking at the header first see information about the functionality instead of about a portability detail. --- sys/sys/queue.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/sys/queue.h b/sys/sys/queue.h index a104867bb2c7..9eb26ac78499 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -1,4 +1,4 @@ -/* $NetBSD: queue.h,v 1.54 2013/04/10 22:22:16 christos Exp $ */ +/* $NetBSD: queue.h,v 1.55 2013/07/17 15:50:59 pooka Exp $ */ /* * Copyright (c) 1991, 1993 @@ -34,8 +34,6 @@ #ifndef _SYS_QUEUE_H_ #define _SYS_QUEUE_H_ -#include - /* * This file defines five types of data structures: singly-linked lists, * lists, simple queues, tail queues, and circular queues. @@ -82,6 +80,17 @@ * For details on the use of these macros, see the queue(3) manual page. */ +/* + * Include the definition of NULL only on NetBSD because sys/null.h + * is not available elsewhere. This conditional makes the header + * portable and it can simply be dropped verbatim into any system. + * The caveat is that on other systems some other header + * must provide NULL before the macros can be used. + */ +#ifdef __NetBSD__ +#include +#endif + /* * List definitions. */