fix: No extern template declaration for MSVC <12.0

This commit is contained in:
Andreas Schuh 2018-10-15 00:22:36 -07:00 committed by Andreas Schuh
parent 82456f220f
commit 754d3329a6
2 changed files with 9 additions and 4 deletions

1
.gitignore vendored
View file

@ -2,6 +2,7 @@
/build/ /build/
/builds/ /builds/
/build-*/ /build-*/
/_build/
.DS_Store .DS_Store
CMakeCache.txt CMakeCache.txt
DartConfiguration.tcl DartConfiguration.tcl

View file

@ -442,10 +442,14 @@ class GFLAGS_DLL_DECL FlagRegisterer {
}; };
// Force compiler to not generate code for the given template specialization. // Force compiler to not generate code for the given template specialization.
#define GFLAGS_DECLARE_FLAG_REGISTERER_CTOR(type) \ #if defined(_MSC_VER) && _MSC_VER < 1800 // Visual Studio 2013 version 12.0
extern template GFLAGS_DLL_DECL FlagRegisterer::FlagRegisterer( \ #define GFLAGS_DECLARE_FLAG_REGISTERER_CTOR(type)
const char* name, const char* help, const char* filename, \ #else
type* current_storage, type* defvalue_storage) #define GFLAGS_DECLARE_FLAG_REGISTERER_CTOR(type) \
extern template GFLAGS_DLL_DECL FlagRegisterer::FlagRegisterer( \
const char* name, const char* help, const char* filename, \
type* current_storage, type* defvalue_storage)
#endif
// Do this for all supported flag types. // Do this for all supported flag types.
GFLAGS_DECLARE_FLAG_REGISTERER_CTOR(bool); GFLAGS_DECLARE_FLAG_REGISTERER_CTOR(bool);