aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2023-12-08 14:25:13 -0600
committerG. Branden Robinson <g.branden.robinson@gmail.com>2023-12-08 14:27:43 -0600
commitdd6b4aada262b8bb858001905531e8be16e5bcad (patch)
treed093b7a8c4d6a8e8059d062419d228d3e8f62c1c
parentf71053b973ee630d4549df9943592c55e3dd7012 (diff)
Manage config.h more consistently.
* src/roff/troff/env.cpp: Ensure that we include config.h (if necessary) _before_ C standard library header math.h. * src/devices/xditview/Dvi.c: * src/devices/xditview/draw.c: * src/devices/xditview/font.c: * src/devices/xditview/lex.c: * src/devices/xditview/page.c: * src/devices/xditview/parse.c: * src/libs/libbib/map.c: * src/libs/libgroff/change_lf.cpp: * src/libs/libgroff/cmap.cpp: * src/libs/libgroff/cset.cpp: * src/libs/libgroff/fmod.c: * src/libs/libgroff/geometry.cpp: * src/libs/libgroff/getcwd.c: * src/libs/libgroff/localcharset.c: * src/libs/libgroff/prime.cpp: * src/libs/libgroff/ptable.cpp: * src/libs/libgroff/quotearg.c: * src/libs/libgroff/spawnvp.c: * src/libs/libxutil/DviChar.c: * src/libs/libxutil/XFontName.c: * src/libs/libxutil/xmalloc.c: * src/preproc/eqn/eqn.ypp: * src/preproc/grn/hdb.cpp: * src/preproc/grn/hpoint.cpp: * src/roff/troff/env.cpp: * src/utils/indxbib/signal.c: Bracket inclusion of config.h with preprocessor test of `HAVE_CONFIG_H` where absent. Use angle bracket rather than double-quote notation for the preprocessor file inclusion. See <https://savannah.gnu.org/bugs/?60035>.
-rw-r--r--ChangeLog38
-rw-r--r--src/devices/xditview/Dvi.c2
-rw-r--r--src/devices/xditview/draw.c2
-rw-r--r--src/devices/xditview/font.c2
-rw-r--r--src/devices/xditview/lex.c2
-rw-r--r--src/devices/xditview/page.c2
-rw-r--r--src/devices/xditview/parse.c2
-rw-r--r--src/libs/libbib/map.c2
-rw-r--r--src/libs/libgroff/change_lf.cpp3
-rw-r--r--src/libs/libgroff/cmap.cpp3
-rw-r--r--src/libs/libgroff/cset.cpp3
-rw-r--r--src/libs/libgroff/fmod.c3
-rw-r--r--src/libs/libgroff/geometry.cpp2
-rw-r--r--src/libs/libgroff/getcwd.c3
-rw-r--r--src/libs/libgroff/localcharset.c2
-rw-r--r--src/libs/libgroff/prime.cpp2
-rw-r--r--src/libs/libgroff/ptable.cpp2
-rw-r--r--src/libs/libgroff/quotearg.c2
-rw-r--r--src/libs/libgroff/spawnvp.c2
-rw-r--r--src/libs/libxutil/DviChar.c2
-rw-r--r--src/libs/libxutil/XFontName.c2
-rw-r--r--src/libs/libxutil/xmalloc.c2
-rw-r--r--src/preproc/eqn/eqn.ypp2
-rw-r--r--src/preproc/grn/hdb.cpp2
-rw-r--r--src/preproc/grn/hpoint.cpp2
-rw-r--r--src/roff/troff/env.cpp7
-rw-r--r--src/utils/indxbib/signal.c2
27 files changed, 92 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 7396c73..4638fee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,41 @@
+2023-12-08 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ Manage config.h more consistently.
+
+ * src/roff/troff/env.cpp: Ensure that we include config.h (if
+ necessary) _before_ C standard library header math.h.
+
+ * src/devices/xditview/Dvi.c:
+ * src/devices/xditview/draw.c:
+ * src/devices/xditview/font.c:
+ * src/devices/xditview/lex.c:
+ * src/devices/xditview/page.c:
+ * src/devices/xditview/parse.c:
+ * src/libs/libbib/map.c:
+ * src/libs/libgroff/change_lf.cpp:
+ * src/libs/libgroff/cmap.cpp:
+ * src/libs/libgroff/cset.cpp:
+ * src/libs/libgroff/fmod.c:
+ * src/libs/libgroff/geometry.cpp:
+ * src/libs/libgroff/getcwd.c:
+ * src/libs/libgroff/localcharset.c:
+ * src/libs/libgroff/prime.cpp:
+ * src/libs/libgroff/ptable.cpp:
+ * src/libs/libgroff/quotearg.c:
+ * src/libs/libgroff/spawnvp.c:
+ * src/libs/libxutil/DviChar.c:
+ * src/libs/libxutil/XFontName.c:
+ * src/libs/libxutil/xmalloc.c:
+ * src/preproc/eqn/eqn.ypp:
+ * src/preproc/grn/hdb.cpp:
+ * src/preproc/grn/hpoint.cpp:
+ * src/roff/troff/env.cpp:
+ * src/utils/indxbib/signal.c: Bracket inclusion of config.h with
+ preprocessor test of `HAVE_CONFIG_H` where absent. Use
+ angle bracket rather than double-quote notation for the
+ preprocessor file inclusion. See
+ <https://savannah.gnu.org/bugs/?60035>.
+
2023-12-07 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/env.cpp (do_hyphenation_patterns_file):
diff --git a/src/devices/xditview/Dvi.c b/src/devices/xditview/Dvi.c
index bc62386..26f0ee6 100644
--- a/src/devices/xditview/Dvi.c
+++ b/src/devices/xditview/Dvi.c
@@ -1,4 +1,6 @@
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#ifndef SABER
#ifndef lint
diff --git a/src/devices/xditview/draw.c b/src/devices/xditview/draw.c
index 288d98a..d1fb148 100644
--- a/src/devices/xditview/draw.c
+++ b/src/devices/xditview/draw.c
@@ -4,7 +4,7 @@
* accept dvi function calls and translate to X
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <X11/Xos.h>
diff --git a/src/devices/xditview/font.c b/src/devices/xditview/font.c
index 8462608..419de4b 100644
--- a/src/devices/xditview/font.c
+++ b/src/devices/xditview/font.c
@@ -4,7 +4,9 @@
* map dvi fonts to X fonts
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <X11/Xos.h>
#include <X11/IntrinsicP.h>
diff --git a/src/devices/xditview/lex.c b/src/devices/xditview/lex.c
index 19cf292..9637210 100644
--- a/src/devices/xditview/lex.c
+++ b/src/devices/xditview/lex.c
@@ -1,4 +1,6 @@
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <X11/Xos.h>
#include <X11/IntrinsicP.h>
diff --git a/src/devices/xditview/page.c b/src/devices/xditview/page.c
index 352d871..a877a84 100644
--- a/src/devices/xditview/page.c
+++ b/src/devices/xditview/page.c
@@ -4,7 +4,9 @@
* map page numbers to file position
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <X11/Xos.h>
#include <X11/IntrinsicP.h>
diff --git a/src/devices/xditview/parse.c b/src/devices/xditview/parse.c
index 456c7da..2c6b48e 100644
--- a/src/devices/xditview/parse.c
+++ b/src/devices/xditview/parse.c
@@ -4,7 +4,9 @@
* parse dvi input
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <X11/Xos.h>
#include <X11/IntrinsicP.h>
diff --git a/src/libs/libbib/map.c b/src/libs/libbib/map.c
index 9eae72b..7da0f6e 100644
--- a/src/libs/libbib/map.c
+++ b/src/libs/libbib/map.c
@@ -16,7 +16,9 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <stdlib.h>
diff --git a/src/libs/libgroff/change_lf.cpp b/src/libs/libgroff/change_lf.cpp
index eb98766..012ac84 100644
--- a/src/libs/libgroff/change_lf.cpp
+++ b/src/libs/libgroff/change_lf.cpp
@@ -16,7 +16,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <string.h>
extern char *strsave(const char *);
diff --git a/src/libs/libgroff/cmap.cpp b/src/libs/libgroff/cmap.cpp
index 3f2c0c3..cc685f3 100644
--- a/src/libs/libgroff/cmap.cpp
+++ b/src/libs/libgroff/cmap.cpp
@@ -17,7 +17,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <ctype.h>
#include "cmap.h"
diff --git a/src/libs/libgroff/cset.cpp b/src/libs/libgroff/cset.cpp
index 6702237..9f080fb 100644
--- a/src/libs/libgroff/cset.cpp
+++ b/src/libs/libgroff/cset.cpp
@@ -17,7 +17,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <ctype.h>
#include "lib.h"
diff --git a/src/libs/libgroff/fmod.c b/src/libs/libgroff/fmod.c
index 45278f9..121ebec 100644
--- a/src/libs/libgroff/fmod.c
+++ b/src/libs/libgroff/fmod.c
@@ -16,7 +16,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <math.h>
double fmod(x, y)
diff --git a/src/libs/libgroff/geometry.cpp b/src/libs/libgroff/geometry.cpp
index c4665c4..971c861 100644
--- a/src/libs/libgroff/geometry.cpp
+++ b/src/libs/libgroff/geometry.cpp
@@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <stdio.h>
diff --git a/src/libs/libgroff/getcwd.c b/src/libs/libgroff/getcwd.c
index dd8b578..a95da60 100644
--- a/src/libs/libgroff/getcwd.c
+++ b/src/libs/libgroff/getcwd.c
@@ -18,7 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Partial emulation of getcwd in terms of getwd. */
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <sys/param.h>
#include <string.h>
#include <errno.h>
diff --git a/src/libs/libgroff/localcharset.c b/src/libs/libgroff/localcharset.c
index 1bc07a4..9ce57a8 100644
--- a/src/libs/libgroff/localcharset.c
+++ b/src/libs/libgroff/localcharset.c
@@ -17,7 +17,9 @@
/* Written by Bruno Haible <bruno@clisp.org>. */
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
/* Specification. */
#include "localcharset.h"
diff --git a/src/libs/libgroff/prime.cpp b/src/libs/libgroff/prime.cpp
index 5ae068d..b1e7347 100644
--- a/src/libs/libgroff/prime.cpp
+++ b/src/libs/libgroff/prime.cpp
@@ -16,7 +16,7 @@ The GNU General Public License version 2 (GPL2) is available in the
internet at <http://www.gnu.org/licenses/gpl-2.0.txt>. */
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <assert.h>
diff --git a/src/libs/libgroff/ptable.cpp b/src/libs/libgroff/ptable.cpp
index 52d09f8..1289f85 100644
--- a/src/libs/libgroff/ptable.cpp
+++ b/src/libs/libgroff/ptable.cpp
@@ -16,7 +16,9 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include "ptable.h"
#include "errarg.h"
diff --git a/src/libs/libgroff/quotearg.c b/src/libs/libgroff/quotearg.c
index 6d2126b..950cc98 100644
--- a/src/libs/libgroff/quotearg.c
+++ b/src/libs/libgroff/quotearg.c
@@ -17,7 +17,9 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/libs/libgroff/spawnvp.c b/src/libs/libgroff/spawnvp.c
index 1fffa2b..765e758 100644
--- a/src/libs/libgroff/spawnvp.c
+++ b/src/libs/libgroff/spawnvp.c
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
-# include "config.h"
+# include <config.h>
#endif
#include <stdio.h>
diff --git a/src/libs/libxutil/DviChar.c b/src/libs/libxutil/DviChar.c
index fe086fc..6e8e9c5 100644
--- a/src/libs/libxutil/DviChar.c
+++ b/src/libs/libxutil/DviChar.c
@@ -22,7 +22,9 @@ internet at <http://www.gnu.org/licenses/gpl-2.0.txt>. */
* font indexes and back
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <stdlib.h>
#include <string.h>
diff --git a/src/libs/libxutil/XFontName.c b/src/libs/libxutil/XFontName.c
index fd31b6f..fa93347 100644
--- a/src/libs/libxutil/XFontName.c
+++ b/src/libs/libxutil/XFontName.c
@@ -21,7 +21,9 @@ internet at <http://www.gnu.org/licenses/gpl-2.0.txt>. */
* build/parse X Font name strings
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <X11/Xlib.h>
#include <X11/Xos.h>
diff --git a/src/libs/libxutil/xmalloc.c b/src/libs/libxutil/xmalloc.c
index 0852c62..7c19c2e 100644
--- a/src/libs/libxutil/xmalloc.c
+++ b/src/libs/libxutil/xmalloc.c
@@ -15,7 +15,9 @@ for more details.
The GNU General Public License version 2 (GPL2) is available in the
internet at <http://www.gnu.org/licenses/gpl-2.0.txt>. */
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
diff --git a/src/preproc/eqn/eqn.ypp b/src/preproc/eqn/eqn.ypp
index 63828fa..c879ea5 100644
--- a/src/preproc/eqn/eqn.ypp
+++ b/src/preproc/eqn/eqn.ypp
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
%{
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <stdio.h>
diff --git a/src/preproc/grn/hdb.cpp b/src/preproc/grn/hdb.cpp
index 9ba3eaa..f253874 100644
--- a/src/preproc/grn/hdb.cpp
+++ b/src/preproc/grn/hdb.cpp
@@ -7,7 +7,7 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <stdlib.h>
diff --git a/src/preproc/grn/hpoint.cpp b/src/preproc/grn/hpoint.cpp
index 5ef0c0a..8c4e5d4 100644
--- a/src/preproc/grn/hpoint.cpp
+++ b/src/preproc/grn/hpoint.cpp
@@ -6,7 +6,7 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <stdlib.h>
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index eb15834..942332d 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -31,7 +31,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "charinfo.h"
#include "macropath.h"
#include "input.h"
-#include <math.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <math.h> // ceil()
symbol default_family("T");
diff --git a/src/utils/indxbib/signal.c b/src/utils/indxbib/signal.c
index 2231b64..7cf0dea 100644
--- a/src/utils/indxbib/signal.c
+++ b/src/utils/indxbib/signal.c
@@ -19,7 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Unfortunately vendors seem to have problems writing a <signal.h>
that is correct for C++, so we implement all signal handling in C. */
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <stdlib.h>
#include <sys/types.h>