chiark / gitweb /
cleanup: move declaration of version[] into secnet.h
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 5 Jun 2011 12:58:06 +0000 (13:58 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Jun 2011 15:38:42 +0000 (16:38 +0100)
Also, #include secnet.h in the autogenerated version.c.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Makefile.in
secnet.c
secnet.h

index dd94837..fba1202 100644 (file)
@@ -136,7 +136,9 @@ secnet:     $(OBJECTS)
        $(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $(OBJECTS) $(LDLIBS)
 
 version.c: Makefile
-       echo "char version[]=\"secnet $(VERSION)\";" >version.c
+       echo "#include \"secnet.h\"" >$@.new
+       echo "char version[]=\"secnet $(VERSION)\";" >>$@.new
+       mv -f $@.new $@
 
 install: all
        $(INSTALL) -d $(prefix)/share/secnet $(sbindir)
index 4c3ec8f..16fa198 100644 (file)
--- a/secnet.c
+++ b/secnet.c
@@ -1,5 +1,3 @@
-extern char version[];
-
 #include "secnet.h"
 #include <stdio.h>
 #include <string.h>
index 656c86d..ede3ffc 100644 (file)
--- a/secnet.h
+++ b/secnet.h
@@ -34,6 +34,10 @@ typedef enum {False,True} bool_t;
 #define ASSERT(x) do { if (!(x)) { fatal("assertion failed line %d file " \
                                         __FILE__,__LINE__); } } while(0)
 
+/* from version.c */
+
+extern char version[];
+
 /* from logmsg.c */
 extern uint32_t message_level;
 extern bool_t secnet_is_daemon;