From: Pavel TvrdĂ­k Date: Tue, 17 Mar 2015 11:31:14 +0000 (+0100) Subject: Separate a definition of NULL to standalone header X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53e27ec79dc5aaf203f5390cf7657956b664a8e8;p=thirdparty%2Fbird.git Separate a definition of NULL to standalone header A lib/list.h had circular dependency through include nest/bird.h nest/bird.h requires lib/birdlib.h lib/birdlib.h requires timer.h timer.h requires lib/resource.h lib/resource.h requires lib/list.h --- diff --git a/lib/Modules b/lib/Modules index 7254df2d0..75cb5fc9f 100644 --- a/lib/Modules +++ b/lib/Modules @@ -25,3 +25,4 @@ event.h checksum.c checksum.h alloca.h +null.h diff --git a/lib/birdlib.h b/lib/birdlib.h index 94054769f..8dc393bb7 100644 --- a/lib/birdlib.h +++ b/lib/birdlib.h @@ -11,6 +11,7 @@ #include "timer.h" #include "alloca.h" +#include "lib/null.h" /* Ugly structure offset handling macros */ @@ -43,10 +44,6 @@ #define BIT32_CLR(b,p) ((b)[(p)/32] &= ~BIT32_VAL(p)) #define BIT32_ZERO(b,l) memset((b), 0, (l)/8) -#ifndef NULL -#define NULL ((void *) 0) -#endif - #ifndef IPV6 #define IP_VERSION 4 #else diff --git a/lib/lists.c b/lib/lists.c index d323a4b68..54cd5de81 100644 --- a/lib/lists.c +++ b/lib/lists.c @@ -26,7 +26,7 @@ #define _BIRD_LISTS_C_ -#include "nest/bird.h" +#include "lib/null.h" #include "lib/lists.h" /** diff --git a/lib/null.h b/lib/null.h new file mode 100644 index 000000000..7c0bf64e3 --- /dev/null +++ b/lib/null.h @@ -0,0 +1,9 @@ +/* + * BIRD Library -- NULL + * + * Can be freely distributed and used under the terms of the GNU GPL. + */ + +#ifndef NULL +#define NULL ((void *) 0) +#endif