From: Nick Bowler Date: Fri, 7 Feb 2020 04:20:16 +0000 (-0500) Subject: Ensure all sources include first. X-Git-Url: http://git.draconx.ca/gitweb/gob-dx.git/commitdiff_plain/154af5b3783df5a53759b700db95b88a1e9365ab Ensure all sources include first. Best practice with Autoconf is that must be included before any standard header, because configure tests may define macros to influence those headers. Now that we depend on flex we can use a %top block to achieve this in the scanner. --- diff --git a/src/checks.c b/src/checks.c index 683fe00..bd6c8e7 100644 --- a/src/checks.c +++ b/src/checks.c @@ -21,7 +21,7 @@ * USA. */ -#include "config.h" +#include #include #include #include diff --git a/src/generate_treefuncs.pl b/src/generate_treefuncs.pl index 56c686a..377fe43 100755 --- a/src/generate_treefuncs.pl +++ b/src/generate_treefuncs.pl @@ -287,6 +287,7 @@ print OUTH "\n#endif /* TREEFUNCS_H */\n"; close (OUTH); +print OUTC "#include \n"; print OUTC "#include \n"; print OUTC "#include \n"; print OUTC "#include \"treefuncs.h\"\n\n"; diff --git a/src/lexer.l b/src/lexer.l index d59a3d9..3e57e8a 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -1,4 +1,6 @@ -/* GOB C Preprocessor +%top{ +/* + * GOB C Preprocessor * Copyright (C) 1999-2000 the Free Software Foundation. * Copyright (C) 2000 Eazel, Inc. * Copyright (C) 2001-2011 George (Jiri) Lebl @@ -20,9 +22,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ -%{ +#include +} -#include "config.h" +%{ #include #include #include diff --git a/src/main.c b/src/main.c index c7171c5..5767215 100644 --- a/src/main.c +++ b/src/main.c @@ -22,7 +22,7 @@ * USA. */ -#include "config.h" +#include #include #include #include diff --git a/src/out.c b/src/out.c index 2d66570..effa4d3 100644 --- a/src/out.c +++ b/src/out.c @@ -1,3 +1,28 @@ +/* + * GOB C Preprocessor + * Copyright (C) 1999,2000 the Free Software Foundation. + * Copyright (C) 2000 Eazel, Inc. + * Copyright (C) 2001-2011 George (Jiri) Lebl + * + * Author: George (Jiri) Lebl + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +#include #include #include #include diff --git a/src/parse.y b/src/parse.y index 9b29d25..d77fb54 100644 --- a/src/parse.y +++ b/src/parse.y @@ -22,7 +22,7 @@ */ %{ -#include "config.h" +#include #include #include #include diff --git a/src/util.c b/src/util.c index 0b26fa1..d040ee4 100644 --- a/src/util.c +++ b/src/util.c @@ -20,7 +20,7 @@ * USA. */ -#include "config.h" +#include #include #include #include