]> git.draconx.ca Git - gob-dx.git/commitdiff
Ensure all sources include <config.h> first.
authorNick Bowler <nbowler@draconx.ca>
Fri, 7 Feb 2020 04:20:16 +0000 (23:20 -0500)
committerNick Bowler <nbowler@draconx.ca>
Fri, 7 Feb 2020 04:24:11 +0000 (23:24 -0500)
Best practice with Autoconf is that <config.h> 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.

src/checks.c
src/generate_treefuncs.pl
src/lexer.l
src/main.c
src/out.c
src/parse.y
src/util.c

index 683fe008dfe7a667900c9ef9633e2a9db164b469..bd6c8e79f02ba190284e36d39ab115d4d12f399d 100644 (file)
@@ -21,7 +21,7 @@
  * USA.
  */
 
-#include "config.h"
+#include <config.h>
 #include <string.h>
 #include <stdio.h>
 #include <glib.h>
index 56c686a1b1c4c2deaf14dd956addb6c59e7dd68c..377fe434d0bd902e12eaca5cc5f9c5a683ba2c3b 100755 (executable)
@@ -287,6 +287,7 @@ print OUTH "\n#endif /* TREEFUNCS_H */\n";
 
 close (OUTH);
 
+print OUTC "#include <config.h>\n";
 print OUTC "#include <glib.h>\n";
 print OUTC "#include <stdarg.h>\n";
 print OUTC "#include \"treefuncs.h\"\n\n";
index d59a3d96b4b2707de33df8041dbdbfd674303a7e..3e57e8ab3ca1a3701d9c7a2a20ff9ea65e7d2d41 100644 (file)
@@ -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
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  * USA.
  */
-%{
+#include <config.h>
+}
 
-#include "config.h" 
+%{
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
index c7171c50fc441390d82d9d9cdf7b43926a650384..5767215395598cef7ed841f4edb636fdf732cabc 100644 (file)
@@ -22,7 +22,7 @@
  * USA.
  */
 
-#include "config.h"
+#include <config.h>
 #include <glib.h>
 #include <time.h>
 #include <stdio.h>
index 2d66570a72040059af0a18dbe0408c8bc59425a2..effa4d3a6757b19fc9a4ebb9cb177540c8d01099 100644 (file)
--- 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 <config.h>
 #include <stdio.h>
 #include <stdarg.h>
 #include <glib.h>
index 9b29d2562109bec13644632cab193900f9054c89..d77fb544ca8054281615b23394e33152549b299e 100644 (file)
@@ -22,7 +22,7 @@
  */
 %{
 
-#include "config.h"
+#include <config.h>
 #include <glib.h>
 #include <stdio.h>
 #include <stdlib.h>
index 0b26fa15f7d7e8b946b26a584967df0ade2c9d97..d040ee44a15749ff8950954c8e6f4b7f4f1652b7 100644 (file)
@@ -20,7 +20,7 @@
  * USA.
  */
 
-#include "config.h"
+#include <config.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>