From 3091de68dd4c4b440f025bfc924e657993045021 Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R" Date: Tue, 15 Sep 2020 20:29:41 -0600 Subject: [PATCH] added src/phreeqcpp/common/PHRQ_exports.h --- CMakeLists.txt | 2 ++ R/Makefile | 4 ++++ src/CSelectedOutput.hxx | 6 +----- src/IPhreeqc.hpp | 6 +----- src/Makefile.am | 1 + src/Var.h | 6 +----- src/phreeqcpp/Makefile.am | 1 + src/phreeqcpp/NameDouble.h | 6 +----- src/phreeqcpp/common/PHRQ_base.h | 6 +----- src/phreeqcpp/common/PHRQ_exports.h | 14 ++++++++++++++ src/phreeqcpp/common/PHRQ_io.h | 6 +----- unit/Makefile.am | 1 + 12 files changed, 29 insertions(+), 30 deletions(-) create mode 100644 src/phreeqcpp/common/PHRQ_exports.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d9147b5..08c32c70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,7 @@ SET(IPhreeqc_SOURCES src/phreeqcpp/common/Parser.h src/phreeqcpp/common/PHRQ_base.cxx src/phreeqcpp/common/PHRQ_base.h + src/phreeqcpp/common/PHRQ_exports.h src/phreeqcpp/common/PHRQ_io.cpp src/phreeqcpp/common/PHRQ_io.h src/phreeqcpp/common/phrqtype.h @@ -281,6 +282,7 @@ set(IPhreeqc_Headers ${PROJECT_SOURCE_DIR}/src/IPhreeqc.hpp ${PROJECT_SOURCE_DIR}/src/IPhreeqcCallbacks.h ${PROJECT_SOURCE_DIR}/src/phreeqcpp/PhreeqcKeywords/Keywords.h + ${PROJECT_SOURCE_DIR}/src/phreeqcpp/common/PHRQ_exports.h ${PROJECT_SOURCE_DIR}/src/phreeqcpp/common/PHRQ_io.h ${PROJECT_SOURCE_DIR}/src/Var.h ) diff --git a/R/Makefile b/R/Makefile index 7e87adc0..9d4888e4 100644 --- a/R/Makefile +++ b/R/Makefile @@ -168,6 +168,7 @@ PSRC = \ $(DEST)/Phreeqc.h \ $(DEST)/PHRQ_base.cpp \ $(DEST)/PHRQ_base.h \ + $(DEST)/PHRQ_exports.h \ $(DEST)/PHRQ_io.cpp \ $(DEST)/PHRQ_io.h \ $(DEST)/PHRQ_io_output.cpp \ @@ -503,6 +504,9 @@ $(DEST)/PHRQ_base.cpp : $(SRC)/common/PHRQ_base.cxx $(DEST)/PHRQ_base.h : $(SRC)/common/PHRQ_base.h $(CP) $< $@ +$(DEST)/PHRQ_exports.h : $(SRC)/common/PHRQ_exports.h + $(CP) $< $@ + $(DEST)/PHRQ_io.cpp : $(SRC)/common/PHRQ_io.cpp $(CP) $< $@ diff --git a/src/CSelectedOutput.hxx b/src/CSelectedOutput.hxx index e5d20ef3..c15e1240 100644 --- a/src/CSelectedOutput.hxx +++ b/src/CSelectedOutput.hxx @@ -15,11 +15,7 @@ #include #include "CVar.hxx" -#if defined(_WINDLL) -#define IPQ_DLL_EXPORT __declspec(dllexport) -#else -#define IPQ_DLL_EXPORT -#endif +#include "PHRQ_exports.h" class IPQ_DLL_EXPORT CSelectedOutput { diff --git a/src/IPhreeqc.hpp b/src/IPhreeqc.hpp index ce668b40..22bdf150 100644 --- a/src/IPhreeqc.hpp +++ b/src/IPhreeqc.hpp @@ -14,11 +14,7 @@ #include "Var.h" /* VRESULT */ #include "PHRQ_io.h" -#if defined(_WINDLL) -#define IPQ_DLL_EXPORT __declspec(dllexport) -#else -#define IPQ_DLL_EXPORT -#endif +#include "PHRQ_exports.h" class Phreeqc; class IErrorReporter; diff --git a/src/Makefile.am b/src/Makefile.am index 9ca76526..bd994e65 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -48,6 +48,7 @@ libiphreeqc_la_SOURCES=\ phreeqcpp/common/Parser.h\ phreeqcpp/common/PHRQ_base.cxx\ phreeqcpp/common/PHRQ_base.h\ + phreeqcpp/common/PHRQ_exports.h\ phreeqcpp/common/PHRQ_io.cpp\ phreeqcpp/common/PHRQ_io.h\ phreeqcpp/common/phrqtype.h\ diff --git a/src/Var.h b/src/Var.h index 39ae1e71..0169bd16 100644 --- a/src/Var.h +++ b/src/Var.h @@ -6,11 +6,7 @@ #ifndef __VAR_H_INC #define __VAR_H_INC -#if defined(_WINDLL) -#define IPQ_DLL_EXPORT __declspec(dllexport) -#else -#define IPQ_DLL_EXPORT -#endif +#include "PHRQ_exports.h" #if defined(R_SO) || defined(NO_NAMELESS_UNION) #define VAR_UNION_NAME u diff --git a/src/phreeqcpp/Makefile.am b/src/phreeqcpp/Makefile.am index b7651924..a568ea8c 100644 --- a/src/phreeqcpp/Makefile.am +++ b/src/phreeqcpp/Makefile.am @@ -24,6 +24,7 @@ phreeqc_SOURCES=\ common/Parser.h\ common/PHRQ_base.cxx\ common/PHRQ_base.h\ + common/PHRQ_exports.h\ common/PHRQ_io.cpp\ common/PHRQ_io.h\ common/phrqtype.h\ diff --git a/src/phreeqcpp/NameDouble.h b/src/phreeqcpp/NameDouble.h index 7df7e53b..9c7c12ba 100644 --- a/src/phreeqcpp/NameDouble.h +++ b/src/phreeqcpp/NameDouble.h @@ -1,11 +1,7 @@ #if !defined(NAMEDOUBLE_H_INCLUDED) #define NAMEDOUBLE_H_INCLUDED -#if defined(_WINDLL) -#define IPQ_DLL_EXPORT __declspec(dllexport) -#else -#define IPQ_DLL_EXPORT -#endif +#include "PHRQ_exports.h" #include // assert #include // std::map diff --git a/src/phreeqcpp/common/PHRQ_base.h b/src/phreeqcpp/common/PHRQ_base.h index 037d0881..26ac25d6 100644 --- a/src/phreeqcpp/common/PHRQ_base.h +++ b/src/phreeqcpp/common/PHRQ_base.h @@ -3,11 +3,7 @@ #include -#if defined(_WINDLL) -#define IPQ_DLL_EXPORT __declspec(dllexport) -#else -#define IPQ_DLL_EXPORT -#endif +#include "PHRQ_exports.h" class PHRQ_io; class IPQ_DLL_EXPORT PHRQ_base diff --git a/src/phreeqcpp/common/PHRQ_exports.h b/src/phreeqcpp/common/PHRQ_exports.h new file mode 100644 index 00000000..d936a60c --- /dev/null +++ b/src/phreeqcpp/common/PHRQ_exports.h @@ -0,0 +1,14 @@ +#ifndef INC_PHRQ_EXPORTS_H +#define INC_PHRQ_EXPORTS_H + +#if defined(_WINDLL) +# ifdef IPhreeqc_EXPORTS +# define IPQ_DLL_EXPORT __declspec(dllexport) +# else +# define IPQ_DLL_EXPORT __declspec(dllimport) +# endif +#else +# define IPQ_DLL_EXPORT +#endif + +#endif // INC_PHRQ_EXPORTS_H diff --git a/src/phreeqcpp/common/PHRQ_io.h b/src/phreeqcpp/common/PHRQ_io.h index f020b2eb..25bfec8a 100644 --- a/src/phreeqcpp/common/PHRQ_io.h +++ b/src/phreeqcpp/common/PHRQ_io.h @@ -1,11 +1,7 @@ #ifndef _PHRQIO_H #define _PHRQIO_H -#if defined(_WINDLL) -#define IPQ_DLL_EXPORT __declspec(dllexport) -#else -#define IPQ_DLL_EXPORT -#endif +#include "PHRQ_exports.h" #include #include diff --git a/unit/Makefile.am b/unit/Makefile.am index 0fa38a59..7048e3d2 100644 --- a/unit/Makefile.am +++ b/unit/Makefile.am @@ -59,6 +59,7 @@ unit_SOURCES=\ ../src/phreeqcpp/Phreeqc.h\ ../src/phreeqcpp/PHRQ_base.cxx\ ../src/phreeqcpp/PHRQ_base.h\ + ../src/phreeqcpp/PHRQ_export.h\ ../src/phreeqcpp/PHRQ_io.cpp\ ../src/phreeqcpp/PHRQ_io.h\ ../src/phreeqcpp/Phreeqc_class.h\