Commit 70eac23c authored by Andreas Schuh's avatar Andreas Schuh

Issue #73 Fix missing STL DLL export warnings of Visual Studio according to KB168958.

parent b2180eb5
...@@ -85,6 +85,14 @@ ...@@ -85,6 +85,14 @@
#include "gflags_declare.h" // IWYU pragma: export #include "gflags_declare.h" // IWYU pragma: export
// Export/import STL instantiations used as data members of exported classes
// \sa http://support.microsoft.com/default.aspx?scid=KB;EN-US;168958
#ifdef GFLAGS_EXTERN_STL
GFLAGS_EXTERN_STL template class GFLAGS_DLL_DECL std::allocator<char>;
GFLAGS_EXTERN_STL template class GFLAGS_DLL_DECL std::basic_string<char>;
#endif
namespace GFLAGS_NAMESPACE { namespace GFLAGS_NAMESPACE {
......
...@@ -43,5 +43,15 @@ ...@@ -43,5 +43,15 @@
# define GFLAGS_DLL_DEFINE_FLAG # define GFLAGS_DLL_DEFINE_FLAG
#endif #endif
// Export/import of STL class instantiations
// \sa http://support.microsoft.com/default.aspx?scid=KB;EN-US;168958
#if defined(GFLAGS_SHARED_LIBS) && defined(_MSC_VER) && _MSC_VER >= 1100
# ifdef GFLAGS_DLL_EXPORT
# define GFLAGS_EXTERN_STL
# else
# define GFLAGS_EXTERN_STL extern
# endif
#endif
#endif // GFLAGS_GFLAGS_CONFIG_H_ #endif // GFLAGS_GFLAGS_CONFIG_H_
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment