From: Andreas Schuh Date: Fri, 14 Mar 2014 16:08:52 +0000 (+0000) Subject: Issue #73 Fix missing STL DLL export warnings of Visual Studio according to KB168958. X-Git-Tag: accepted/tizen/5.0/unified/20181102.024438~134^2~11^2~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70eac23c1b20da94100b2c62081572d80c47ef0b;p=platform%2Fupstream%2Fgflags.git Issue #73 Fix missing STL DLL export warnings of Visual Studio according to KB168958. --- diff --git a/src/gflags.h.in b/src/gflags.h.in index f68f7ab..6ca0a4b 100644 --- a/src/gflags.h.in +++ b/src/gflags.h.in @@ -85,6 +85,14 @@ #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; + GFLAGS_EXTERN_STL template class GFLAGS_DLL_DECL std::basic_string; +#endif + + namespace GFLAGS_NAMESPACE { diff --git a/src/gflags_config.h.in b/src/gflags_config.h.in index df9b58b..6fa1289 100644 --- a/src/gflags_config.h.in +++ b/src/gflags_config.h.in @@ -43,5 +43,15 @@ # define GFLAGS_DLL_DEFINE_FLAG #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_ \ No newline at end of file