Code

Guard config.h include with HAVE_CONFIG_H
authorJonas Fonseca <fonseca@diku.dk>
Wed, 22 Aug 2007 17:36:00 +0000 (19:36 +0200)
committerJonas Fonseca <fonseca@diku.dk>
Wed, 22 Aug 2007 17:36:00 +0000 (19:36 +0200)
... and add -DHAVE_CONFIG_H to CPPFLAGS in config.make.in.

config.make.in
tig.c

index 1b48ff81fa50f0db491c8e98c744807ea817ae83..f863248d3fa2378003cdbd8cf4a3d62452788a88 100644 (file)
@@ -7,6 +7,7 @@ datarootdir = @datarootdir@
 
 CC = @CC@
 CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@ -DHAVE_CONFIG_H
 LDFLAGS = @LDFLAGS@
 LDLIBS = @LIBS@
 
diff --git a/tig.c b/tig.c
index 82dbd23e7c01831d62549d5852c0c27540a77867..6a5be7ffb76e0a758e4fef1d67f17ff022c7f67e 100644 (file)
--- a/tig.c
+++ b/tig.c
  * GNU General Public License for more details.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #ifndef TIG_VERSION
 #define TIG_VERSION "unknown-version"
 #endif
@@ -40,8 +44,6 @@
 
 #include <curses.h>
 
-#include "config.h"
-
 #if __GNUC__ >= 3
 #define __NORETURN __attribute__((__noreturn__))
 #else