]> git.draconx.ca Git - dxcommon.git/commitdiff
tap: Include <config.h> as needed.
authorNick Bowler <nbowler@draconx.ca>
Tue, 13 Jun 2023 01:01:27 +0000 (21:01 -0400)
committerNick Bowler <nbowler@draconx.ca>
Tue, 13 Jun 2023 01:01:27 +0000 (21:01 -0400)
When using a config header in Autoconf, it is necessary to #include
that header before including anything else that might be influenced
by configure tests, which includes standard C headers.

In particular, things can go completely off the rails if Gnulib is
involved and generates replacements for the standard headers used
by this file.

src/tap.c

index 4416a9cbd8b024cda3ebc17e8db1355689951175..4d80c75405a3cdbcfc7db9c39f2a3e101db7b237 100644 (file)
--- a/src/tap.c
+++ b/src/tap.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2015 Nick Bowler
+ * Copyright © 2015, 2023 Nick Bowler
  *
  * Simple TAP output library for C programs.
  *
@@ -8,6 +8,10 @@
  * There is NO WARRANTY, to the extent permitted by law.
  */
 
+#if HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <assert.h>