From abb80b511fc45f86f40207240c9e9ef6cea328b4 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 --- CSelectedOutput.hxx | 6 +----- IPhreeqc.hpp | 6 +----- Makefile.am | 1 + Var.h | 6 +----- phreeqcpp/Makefile.am | 1 + phreeqcpp/NameDouble.h | 6 +----- phreeqcpp/common/PHRQ_base.h | 6 +----- phreeqcpp/common/PHRQ_exports.h | 14 ++++++++++++++ phreeqcpp/common/PHRQ_io.h | 6 +----- 9 files changed, 22 insertions(+), 30 deletions(-) create mode 100644 phreeqcpp/common/PHRQ_exports.h diff --git a/CSelectedOutput.hxx b/CSelectedOutput.hxx index e5d20ef3..c15e1240 100644 --- a/CSelectedOutput.hxx +++ b/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/IPhreeqc.hpp b/IPhreeqc.hpp index ce668b40..22bdf150 100644 --- a/IPhreeqc.hpp +++ b/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/Makefile.am b/Makefile.am index 9ca76526..bd994e65 100644 --- a/Makefile.am +++ b/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/Var.h b/Var.h index 39ae1e71..0169bd16 100644 --- a/Var.h +++ b/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/phreeqcpp/Makefile.am b/phreeqcpp/Makefile.am index b7651924..a568ea8c 100644 --- a/phreeqcpp/Makefile.am +++ b/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/phreeqcpp/NameDouble.h b/phreeqcpp/NameDouble.h index 7df7e53b..9c7c12ba 100644 --- a/phreeqcpp/NameDouble.h +++ b/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/phreeqcpp/common/PHRQ_base.h b/phreeqcpp/common/PHRQ_base.h index 037d0881..26ac25d6 100644 --- a/phreeqcpp/common/PHRQ_base.h +++ b/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/phreeqcpp/common/PHRQ_exports.h b/phreeqcpp/common/PHRQ_exports.h new file mode 100644 index 00000000..d936a60c --- /dev/null +++ b/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/phreeqcpp/common/PHRQ_io.h b/phreeqcpp/common/PHRQ_io.h index f020b2eb..25bfec8a 100644 --- a/phreeqcpp/common/PHRQ_io.h +++ b/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