From a69b2544d613b4bee404988710503720c487119a Mon Sep 17 00:00:00 2001 From: Dreamer Date: Wed, 3 Aug 2016 10:25:38 +0300 Subject: [PATCH] Fix Windows linker errors and warnings. (#166) --- src/gflags.cc | 3 ++- src/gflags_declare.h.in | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gflags.cc b/src/gflags.cc index bbd58ec..3464b3f 100644 --- a/src/gflags.cc +++ b/src/gflags.cc @@ -96,6 +96,7 @@ #if defined(HAVE_FNMATCH_H) # include #elif defined(HAVE_SHLWAPI_H) +# define NO_SHLWAPI_ISOS # include #endif #include // For va_list and related operations @@ -1467,7 +1468,7 @@ FlagRegisterer::FlagRegisterer(const char* name, // Force compiler to generate code for the given template specialization. #define INSTANTIATE_FLAG_REGISTERER_CTOR(type) \ - template FlagRegisterer::FlagRegisterer( \ + template GFLAGS_DLL_DECL FlagRegisterer::FlagRegisterer( \ const char* name, const char* help, const char* filename, \ type* current_storage, type* defvalue_storage) diff --git a/src/gflags_declare.h.in b/src/gflags_declare.h.in index a8b76f7..5e01198 100644 --- a/src/gflags_declare.h.in +++ b/src/gflags_declare.h.in @@ -56,7 +56,7 @@ // We always want to import variables declared in user code #ifndef GFLAGS_DLL_DECLARE_FLAG -# ifdef _MSC_VER +# if @GFLAGS_IS_A_DLL@ && defined(_MSC_VER) # define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport) # else # define GFLAGS_DLL_DECLARE_FLAG -- 2.7.4