aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-11-27 11:50:16 -0800
committerGuy Harris <guy@alum.mit.edu>2017-11-27 11:50:16 -0800
commit90924a7c672244bcfaf1b4d5c88471bb548705ee (patch)
treefd9341d176a0971c839481dc95349276b1f31983
parentde8f67efe0118b7e3da1f3450f0f0020f696628c (diff)
Use BUILDING_PCAP to mean "we're building libpcap".
"We're building libpcap" and "we're building a libpcap shared library" are different; the former is true even when building a static libpcap. Use BUILDING_PCAP for the former and pcap_EXPORTS for the latter.
-rw-r--r--CMakeLists.txt4
-rw-r--r--Makefile.in2
-rw-r--r--pcap/pcap.h2
3 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ca129f67..ad95aada 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1547,6 +1547,8 @@ if(BUILD_SHARED_LIBS)
${PROJECT_EXTERNAL_OBJECT_LIST}
)
add_dependencies(${LIBRARY_NAME} SerializeTarget)
+ set_target_properties(${LIBRARY_NAME} PROPERTIES
+ COMPILE_DEFINITIONS BUILDING_PCAP)
endif(BUILD_SHARED_LIBS)
add_library(${LIBRARY_NAME}_static STATIC
@@ -1556,6 +1558,8 @@ add_library(${LIBRARY_NAME}_static STATIC
${PROJECT_EXTERNAL_OBJECT_LIST}
)
add_dependencies(${LIBRARY_NAME}_static SerializeTarget)
+set_target_properties(${LIBRARY_NAME}_static PROPERTIES
+ COMPILE_DEFINITIONS BUILDING_PCAP)
if(WIN32)
if(BUILD_SHARED_LIBS)
diff --git a/Makefile.in b/Makefile.in
index 746543ae..4f17169a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -52,7 +52,7 @@ MKDEP = @MKDEP@
CCOPT = @V_CCOPT@
SHLIB_CCOPT = @V_SHLIB_CCOPT@
INCLS = -I. @V_INCLS@
-DEFS = -Dpcap_EXPORTS @DEFS@ @V_DEFS@
+DEFS = -DBUILDING_PCAP -Dpcap_EXPORTS @DEFS@ @V_DEFS@
ADDLOBJS = @ADDLOBJS@
ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@
LIBS = @LIBS@
diff --git a/pcap/pcap.h b/pcap/pcap.h
index 11a2e87e..d32e2a9a 100644
--- a/pcap/pcap.h
+++ b/pcap/pcap.h
@@ -419,7 +419,7 @@ PCAP_API pcap_t *pcap_open_offline(const char *, char *);
* runtime with which libpcap was built. (Maybe once the Universal CRT
* rules the world, this will cease to be a problem.)
*/
- #ifndef pcap_EXPORTS
+ #ifndef BUILDING_PCAP
#define pcap_fopen_offline_with_tstamp_precision(f,p,b) \
pcap_hopen_offline_with_tstamp_precision(_get_osfhandle(_fileno(f)), p, b)
#define pcap_fopen_offline(f,b) \