From decfff2f515623c127671e5d7643e533cf1e4fad Mon Sep 17 00:00:00 2001 From: Joris Vaillant Date: Thu, 18 Jan 2024 15:50:16 +0100 Subject: [PATCH] [config.hh] Add XXX_EXPLICIT_INSTANTIATION_DEFINITION_DLLAPI macro --- config.hh.cmake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/config.hh.cmake b/config.hh.cmake index a6e79b8c8..d3b4a367b 100644 --- a/config.hh.cmake +++ b/config.hh.cmake @@ -35,7 +35,8 @@ // Explicit template instantiation on Windows need to add // dllexport on the definition and dllimport on the declaration. // The XXX_EXPLICIT_INSTANTIATION_DECLARATION_DLLAPI macro -// should be set on the declaration while the XXX_DLLAPI macro +// should be set on the declaration while +// the XXX_EXPLICIT_INSTANTIATION_DEFINITION_DLLAPI macro // should be set on the definition. # if defined _WIN32 || defined __CYGWIN__ // On Microsoft Windows, use dllimport and dllexport to tag symbols. @@ -44,6 +45,8 @@ # define @LIBRARY_NAME@_DLLLOCAL # define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DECLARATION_DLLIMPORT __declspec(dllimport) # define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DECLARATION_DLLEXPORT +# define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DEFINITION_DLLIMPORT __declspec(dllimport) +# define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DEFINITION_DLLEXPORT __declspec(dllexport) # else // On Linux, for GCC >= 4, tag symbols using GCC extension. # if __GNUC__ >= 4 @@ -52,6 +55,8 @@ # define @LIBRARY_NAME@_DLLLOCAL __attribute__ ((visibility("hidden"))) # define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DECLARATION_DLLIMPORT __attribute__ ((visibility("default"))) # define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DECLARATION_DLLEXPORT __attribute__ ((visibility("default"))) +# define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DEFINITION_DLLIMPORT +# define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DEFINITION_DLLEXPORT # else // Otherwise (GCC < 4 or another compiler is used), export everything. # define @LIBRARY_NAME@_DLLIMPORT @@ -59,6 +64,8 @@ # define @LIBRARY_NAME@_DLLLOCAL # define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DECLARATION_DLLIMPORT # define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DECLARATION_DLLEXPORT +# define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DEFINITION_DLLIMPORT +# define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DEFINITION_DLLEXPORT # endif // __GNUC__ >= 4 # endif // defined _WIN32 || defined __CYGWIN__ @@ -76,9 +83,11 @@ # ifdef @EXPORT_SYMBOL@ # define @LIBRARY_NAME@_DLLAPI @LIBRARY_NAME@_DLLEXPORT # define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DECLARATION_DLLAPI @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DECLARATION_DLLEXPORT +# define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DEFINITION_DLLAPI @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DEFINITION_DLLEXPORT # else # define @LIBRARY_NAME@_DLLAPI @LIBRARY_NAME@_DLLIMPORT # define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DECLARATION_DLLAPI @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DECLARATION_DLLIMPORT +# define @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DEFINITION_DLLAPI @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DEFINITION_DLLIMPORT # endif // @LIBRARY_NAME@_EXPORTS # define @LIBRARY_NAME@_LOCAL @LIBRARY_NAME@_DLLLOCAL # endif // @LIBRARY_NAME@_STATIC