Skip to content

Commit

Permalink
[config.hh] Add XXX_EXPLICIT_INSTANTIATION_DEFINITION_DLLAPI macro
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisv committed Jan 18, 2024
1 parent 93c59c7 commit decfff2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion config.hh.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -52,13 +55,17 @@
# 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
# define @LIBRARY_NAME@_DLLEXPORT
# 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__

Expand All @@ -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
Expand Down

0 comments on commit decfff2

Please sign in to comment.