*: fix config.h/zebra.h include order

config.h (or, transitively, zebra.h) must be the first include file
listed for autoconf things like _GNU_SOURCE and _POSIX_C_SOURCE to work
correctly.

Signed-off-by: David Lamparter <equinox@diac24.net>
This commit is contained in:
David Lamparter 2018-08-28 10:57:13 +02:00
parent dbac691da6
commit b45ac5f5c6
54 changed files with 185 additions and 25 deletions

View file

@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "babel_filter.h" #include "babel_filter.h"
#include "vty.h" #include "vty.h"
#include "filter.h" #include "filter.h"

View file

@ -21,6 +21,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/time.h> #include <sys/time.h>
#include <sys/param.h> #include <sys/param.h>
#include <time.h> #include <time.h>

View file

@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>

View file

@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <string.h> #include <string.h>

View file

@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/time.h> #include <sys/time.h>
#include <time.h> #include <time.h>
#include <string.h> #include <string.h>

View file

@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View file

@ -21,6 +21,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>

View file

@ -18,9 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "math.h"
#include <zebra.h> #include <zebra.h>
#include <math.h>
#include "prefix.h" #include "prefix.h"
#include "lib_errors.h" #include "lib_errors.h"

View file

@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <errno.h>
#include "lib/zebra.h" #include "lib/zebra.h"
#include "lib/prefix.h" #include "lib/prefix.h"
#include "lib/agg_table.h" #include "lib/agg_table.h"

View file

@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <errno.h>
#include "lib/zebra.h" #include "lib/zebra.h"
#include "lib/prefix.h" #include "lib/prefix.h"
#include "lib/agg_table.h" #include "lib/agg_table.h"

View file

@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <errno.h>
#include "lib/zebra.h" #include "lib/zebra.h"
#include "lib/prefix.h" #include "lib/prefix.h"
#include "lib/table.h" #include "lib/table.h"

View file

@ -23,8 +23,6 @@
* Purpose: Handle import of routes from BGP to RFAPI * Purpose: Handle import of routes from BGP to RFAPI
*/ */
#include <errno.h>
#include "lib/zebra.h" #include "lib/zebra.h"
#include "lib/prefix.h" #include "lib/prefix.h"
#include "lib/agg_table.h" #include "lib/agg_table.h"

View file

@ -24,8 +24,6 @@
/* TBD remove unneeded includes */ /* TBD remove unneeded includes */
#include <errno.h>
#include "lib/zebra.h" #include "lib/zebra.h"
#include "lib/prefix.h" #include "lib/prefix.h"
#include "lib/agg_table.h" #include "lib/agg_table.h"

View file

@ -23,8 +23,6 @@
* Purpose: maintain per-nve ribs and generate change lists * Purpose: maintain per-nve ribs and generate change lists
*/ */
#include <errno.h>
#include "lib/zebra.h" #include "lib/zebra.h"
#include "lib/prefix.h" #include "lib/prefix.h"
#include "lib/agg_table.h" #include "lib/agg_table.h"

View file

@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <errno.h>
#include "lib/zebra.h" #include "lib/zebra.h"
#include "lib/prefix.h" #include "lib/prefix.h"
#include "lib/agg_table.h" #include "lib/agg_table.h"

View file

@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
/* stub rfp */ /* stub rfp */
#include "rfp_internal.h" #include "rfp_internal.h"
#include "bgpd/rfapi/rfapi.h" #include "bgpd/rfapi/rfapi.h"

View file

@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
/* dummy test program */ /* dummy test program */
#include <stdio.h> #include <stdio.h>

View file

@ -67,8 +67,8 @@
* 7- state not changed, usually by receiving not last reply * 7- state not changed, usually by receiving not last reply
*/ */
#include <thread.h>
#include <zebra.h> #include <zebra.h>
#include <thread.h>
#include "prefix.h" #include "prefix.h"
#include "table.h" #include "table.h"

View file

@ -17,6 +17,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef __OpenBSD__ #ifdef __OpenBSD__
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>

View file

@ -17,6 +17,11 @@
* with this program; see the file COPYING; if not, write to the Free Software * with this program; see the file COPYING; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View file

@ -14,6 +14,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>

View file

@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <sys/types.h> #include <sys/types.h>

View file

@ -23,6 +23,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "command.h" #include "command.h"
#include "memory_vty.h" #include "memory_vty.h"
#include "graph.h" #include "graph.h"

View file

@ -23,6 +23,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "command.h" #include "command.h"
#include "memory_vty.h" #include "memory_vty.h"

View file

@ -20,6 +20,10 @@
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "memory.h" #include "memory.h"
#include "hook.h" #include "hook.h"

View file

@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "lib_errors.h" #include "lib_errors.h"
/* clang-format off */ /* clang-format off */

View file

@ -41,6 +41,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h> #include <stdlib.h>
#include <lib/openbsd-tree.h> #include <lib/openbsd-tree.h>

View file

@ -17,6 +17,11 @@
* with this program; see the file COPYING; if not, write to the Free Software * with this program; see the file COPYING; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>

View file

@ -20,11 +20,13 @@
/* adapted for Quagga from glibc patch submission originally from /* adapted for Quagga from glibc patch submission originally from
* Florian Weimer <fweimer@redhat.com>, 2016-05-18 */ * Florian Weimer <fweimer@redhat.com>, 2016-05-18 */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include "config.h"
#ifndef HAVE_STRLCAT #ifndef HAVE_STRLCAT
#undef strlcat #undef strlcat

View file

@ -20,9 +20,11 @@
/* adapted for Quagga from glibc patch submission originally from /* adapted for Quagga from glibc patch submission originally from
* Florian Weimer <fweimer@redhat.com>, 2016-05-18 */ * Florian Weimer <fweimer@redhat.com>, 2016-05-18 */
#include <string.h> #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif
#include <string.h>
#ifndef HAVE_STRLCPY #ifndef HAVE_STRLCPY
#undef strlcpy #undef strlcpy

View file

@ -7,6 +7,10 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>

View file

@ -7,6 +7,10 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <fcntl.h> #include <fcntl.h>
#include <net/if.h> #include <net/if.h>
#include <netinet/if_ether.h> #include <netinet/if_ether.h>

View file

@ -7,6 +7,10 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/socket.h> #include <sys/socket.h>
#include <linux/netlink.h> #include <linux/netlink.h>
#include <linux/rtnetlink.h> #include <linux/rtnetlink.h>

View file

@ -7,6 +7,10 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h> #include <string.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/un.h> #include <sys/un.h>

View file

@ -7,6 +7,10 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <net/if_arp.h> #include <net/if_arp.h>
#include "zebra.h" #include "zebra.h"
#include "linklist.h" #include "linklist.h"

View file

@ -7,6 +7,10 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <unistd.h> #include <unistd.h>
#include "zebra.h" #include "zebra.h"

View file

@ -7,6 +7,10 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <netinet/if_ether.h> #include <netinet/if_ether.h>
#include "nhrpd.h" #include "nhrpd.h"
#include "zbuf.h" #include "zbuf.h"

View file

@ -7,6 +7,10 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <netinet/if_ether.h> #include <netinet/if_ether.h>
#include "zebra.h" #include "zebra.h"

View file

@ -7,6 +7,10 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "nhrpd.h" #include "nhrpd.h"
#include "table.h" #include "table.h"
#include "memory.h" #include "memory.h"

View file

@ -7,6 +7,10 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "nhrpd.h" #include "nhrpd.h"
#include "table.h" #include "table.h"
#include "memory.h" #include "memory.h"

View file

@ -7,6 +7,10 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <ares.h> #include <ares.h>
#include <ares_version.h> #include <ares_version.h>

View file

@ -7,6 +7,10 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h> #include <string.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/un.h> #include <sys/un.h>

View file

@ -7,7 +7,10 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#define _GNU_SOURCE #ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>

View file

@ -7,6 +7,10 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>

View file

@ -24,6 +24,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View file

@ -17,6 +17,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef __linux__ #ifdef __linux__
#include "pim_igmp_mtrace.h" #include "pim_igmp_mtrace.h"

View file

@ -10,6 +10,10 @@
* *
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef __linux__ #ifdef __linux__
#include <stdio.h> #include <stdio.h>

View file

@ -17,6 +17,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef __linux__ #ifdef __linux__
#include <asm/types.h> #include <asm/types.h>

View file

@ -17,6 +17,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "pim_igmp_stats.h" #include "pim_igmp_stats.h"
void igmp_stats_init(struct igmp_stats *stats) void igmp_stats_init(struct igmp_stats *stats)

View file

@ -22,6 +22,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "linear_allocator.h" #include "linear_allocator.h"
#include "qpb_allocator.h" #include "qpb_allocator.h"

View file

@ -1,3 +1,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "test_fuzz_isis_tlv_tests.h" #include "test_fuzz_isis_tlv_tests.h"
#include <zebra.h> #include <zebra.h>

View file

@ -21,6 +21,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "lib/stream.h" #include "lib/stream.h"
#include "lib/zclient.h" #include "lib/zclient.h"

View file

@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "command.h" #include "command.h"
#include "graph.h" #include "graph.h"
#include "vector.h" #include "vector.h"

View file

@ -25,12 +25,17 @@
* the whole automake/config.h dance. * the whole automake/config.h dance.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_LXC #ifdef HAVE_LXC
#define _GNU_SOURCE #define _GNU_SOURCE
#include <sched.h> #include <sched.h>
#endif /* HAVE_LXC */ #endif /* HAVE_LXC */
#include <stddef.h> #include <stddef.h>
#undef VERSION
#define VERSION "1.9.18" #define VERSION "1.9.18"
#define MIN_POLL_INTERVAL 20000 /*us*/ #define MIN_POLL_INTERVAL 20000 /*us*/