]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Separate a definition of NULL to standalone header
authorPavel Tvrdík <pawel.tvrdik@gmail.cz>
Tue, 17 Mar 2015 11:31:14 +0000 (12:31 +0100)
committerPavel Tvrdík <pawel.tvrdik@gmail.cz>
Tue, 17 Mar 2015 11:31:14 +0000 (12:31 +0100)
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

lib/Modules
lib/birdlib.h
lib/lists.c
lib/null.h [new file with mode: 0644]

index 7254df2d086be9512c451d764481a5a634346e00..75cb5fc9fda744301f164a915390498d3fac2035 100644 (file)
@@ -25,3 +25,4 @@ event.h
 checksum.c
 checksum.h
 alloca.h
+null.h
index 94054769f6efd6bce48359df6a1da86e44e94231..8dc393bb7e418c603ff44c856af81f5560eb9a3c 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "timer.h"
 #include "alloca.h"
+#include "lib/null.h"
 
 /* Ugly structure offset handling macros */
 
 #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
index d323a4b68d5bbb64a2f6d53199ee5c72a38619ac..54cd5de81f4dda35aaafe2442b9da527e2d8726f 100644 (file)
@@ -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 (file)
index 0000000..7c0bf64
--- /dev/null
@@ -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