Browse Source

*: make sure zebra.h is always included first

zebra.h pulls in config.h, which results in fiddling with things like
__FILE_OFFSET_BITS. It must always be included first, in order to set
flags that influence the compiler via <features.h>.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter 4 years ago
parent
commit
821df2cf18

+ 1 - 0
isisd/topology/random.c

@@ -7,6 +7,7 @@
 /*                                                                   */
 /*********************************************************************/
 
+#include <zebra.h>
 #include <sys/types.h>
 #include <sys/times.h>
 

+ 1 - 0
isisd/topology/spacyc.c

@@ -1,3 +1,4 @@
+#include <zebra.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>

+ 2 - 2
isisd/topology/spgrid.c

@@ -1,11 +1,11 @@
+#include <zebra.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "random.c"
 
-#include <zebra.h>
-
 #include "thread.h"
 #include "vty.h"
 #include "log.h"

+ 2 - 0
isisd/topology/sprand.c

@@ -1,3 +1,5 @@
+#include <zebra.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>

+ 0 - 4
lib/getopt.c

@@ -30,10 +30,6 @@
 # define _NO_PROTO
 #endif
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
 #include <zebra.h>
 
 #if !defined __STDC__ || !__STDC__

+ 0 - 4
lib/getopt1.c

@@ -20,10 +20,6 @@
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
    USA.  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include <zebra.h>
 #include "getopt.h"
 

+ 1 - 1
lib/stream.c

@@ -20,8 +20,8 @@
  * 02111-1307, USA.  
  */
 
-#include <stddef.h>
 #include <zebra.h>
+#include <stddef.h>
 
 #include "stream.h"
 #include "memory.h"

+ 1 - 1
lib/workqueue.c

@@ -21,7 +21,7 @@
  * 02111-1307, USA.  
  */
 
-#include <lib/zebra.h>
+#include <zebra.h>
 #include "thread.h"
 #include "memory.h"
 #include "workqueue.h"

+ 2 - 2
pimd/pim_cmd.c

@@ -20,10 +20,10 @@
   $QuaggaId: $Format:%an, %ai, %h$ $
 */
 
-#include <sys/ioctl.h>
-
 #include <zebra.h>
 
+#include <sys/ioctl.h>
+
 #include "command.h"
 #include "if.h"
 #include "prefix.h"

+ 2 - 0
pimd/pim_igmp_join.c

@@ -20,6 +20,8 @@
   $QuaggaId: $Format:%an, %ai, %h$ $
 */
 
+#include <zebra.h>
+
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <string.h>

+ 2 - 0
pimd/pim_int.c

@@ -20,6 +20,8 @@
   $QuaggaId: $Format:%an, %ai, %h$ $
 */
 
+#include <zebra.h>
+
 #include <string.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>

+ 2 - 1
pimd/pim_signals.c

@@ -20,9 +20,10 @@
   $QuaggaId: $Format:%an, %ai, %h$ $
 */
 
+#include <zebra.h>
+
 #include <signal.h>
 
-#include <zebra.h>
 #include "sigevent.h"
 #include "memory.h"
 #include "log.h"

+ 1 - 1
pimd/pim_sock.c

@@ -20,6 +20,7 @@
   $QuaggaId: $Format:%an, %ai, %h$ $
 */
 
+#include <zebra.h>
 #include "pim_mroute.h"
 
 #include <sys/types.h>
@@ -31,7 +32,6 @@
 #include <netdb.h>
 #include <errno.h>
 
-#include <zebra.h>
 #include "log.h"
 #include "privs.h"
 

+ 2 - 0
pimd/pim_static.c

@@ -20,6 +20,8 @@
   $QuaggaId: $Format:%an, %ai, %h$ $
 */
 
+#include <zebra.h>
+
 #include "pim_static.h"
 #include "pim_time.h"
 #include "pim_str.h"

+ 2 - 2
pimd/pim_str.c

@@ -20,12 +20,12 @@
   $QuaggaId: $Format:%an, %ai, %h$ $
 */
 
+#include <zebra.h>
+
 #include <stdio.h>
 #include <errno.h>
 #include <string.h>
 
-#include <zebra.h>
-
 #include "log.h"
 
 #include "pim_str.h"

+ 2 - 1
pimd/pim_time.c

@@ -20,11 +20,12 @@
   $QuaggaId: $Format:%an, %ai, %h$ $
 */
 
+#include <zebra.h>
+
 #include <string.h>
 #include <sys/time.h>
 #include <time.h>
 
-#include <zebra.h>
 #include "log.h"
 #include "thread.h"
 

+ 2 - 0
pimd/pim_version.c

@@ -20,6 +20,8 @@
   $QuaggaId: $Format:%an, %ai, %h$ $
 */
 
+#include <zebra.h>
+
 #include "pim_version.h"
 
 const char * const PIMD_VERSION = PIMD_VERSION_STR;

+ 2 - 0
tests/prng.c

@@ -23,6 +23,8 @@
  * 02111-1307, USA.
  */
 
+#include <zebra.h>
+
 #include <assert.h>
 #include <stdlib.h>
 #include <string.h>

+ 2 - 0
tests/test-cli.c

@@ -20,6 +20,8 @@
  * 02111-1307, USA.
  */
 
+#include <zebra.h>
+
 #include "common-cli.h"
 
 DUMMY_DEFUN(cmd0,  "arg ipv4 A.B.C.D");

+ 2 - 2
tests/test-timer-correctness.c

@@ -23,11 +23,11 @@
  * 02111-1307, USA.
  */
 
+#include <zebra.h>
+
 #include <stdio.h>
 #include <unistd.h>
 
-#include <zebra.h>
-
 #include "memory.h"
 #include "pqueue.h"
 #include "prng.h"

+ 3 - 2
tests/test-timer-performance.c

@@ -22,11 +22,12 @@
  * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
-#include <stdio.h>
-#include <unistd.h>
 
 #include <zebra.h>
 
+#include <stdio.h>
+#include <unistd.h>
+
 #include "thread.h"
 #include "pqueue.h"
 #include "prng.h"