]> The Tcpdump Group git mirrors - libpcap/commitdiff
We don't need version.c, either.
authorGuy Harris <[email protected]>
Wed, 4 Oct 2017 05:01:19 +0000 (22:01 -0700)
committerGuy Harris <[email protected]>
Wed, 4 Oct 2017 05:01:19 +0000 (22:01 -0700)
Just put pcap_version[] into pcap.c

CMakeLists.txt
Makefile.in
pcap.c
version.c [deleted file]

index 1ec1d55224977631b0abc810167dd01e0d2378b3..2a96955cf414582d1286f100856782fb4c33def5 100644 (file)
@@ -463,7 +463,6 @@ set(PROJECT_SOURCE_LIST_C
     savefile.c
     sf-pcap-ng.c
     sf-pcap.c
-    version.c
     bpf/net/bpf_filter.c
 )
 
index 74cf7c1d75f92244f665d5b5e19d508462d30fc2..432802e8b7630fdbf18a00076b903ec879d45252 100644 (file)
@@ -88,7 +88,7 @@ FSRC =  @V_FINDALLDEVS@
 SSRC =  @SSRC@
 CSRC = pcap.c gencode.c optimize.c nametoaddr.c etherent.c \
        savefile.c sf-pcap.c sf-pcap-ng.c pcap-common.c \
-       version.c bpf_image.c bpf_dump.c
+       bpf_image.c bpf_dump.c
 GENSRC = scanner.c grammar.c bpf_filter.c
 LIBOBJS = @LIBOBJS@
 
diff --git a/pcap.c b/pcap.c
index fb65c9db3ca7701dedbdae80a25bee47e81224bf..9455b53de66918f3e6229fb9f132f8a215d72cd9 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -171,6 +171,14 @@ pcap_wsockinit(void)
 }
 #endif /* _WIN32 */
 
+/*
+ * String containing the library version.
+ * Not explicitly exported via a header file - the right API to use
+ * is pcap_lib_version() - but some programs included it, so we
+ * provide it.
+ */
+PCAP_API_DEF char pcap_version[] = PACKAGE_VERSION;
+
 static int
 pcap_not_initialized(pcap_t *pcap)
 {
diff --git a/version.c b/version.c
deleted file mode 100644 (file)
index 0dc3abd..0000000
--- a/version.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "config.h"
-
-#include <pcap/funcattrs.h>
-
-PCAP_API_DEF char pcap_version[] = PACKAGE_VERSION;