From 03d8b6d9d79d25a1ac3400940b57c1b0416c147f Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 17 May 2013 13:16:36 -0700 Subject: [PATCH] msvc on windows breaks with singleton declared but gcc needs default visibility to avoid double singleton registration across dlls when using -fvisiblity=hidden --- include/mapnik/utils.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/mapnik/utils.hpp b/include/mapnik/utils.hpp index bbfcf7bd9..552fafaf3 100644 --- a/include/mapnik/utils.hpp +++ b/include/mapnik/utils.hpp @@ -94,9 +94,16 @@ public: } }; +#ifdef __GNUC__ template class CreatePolicy=CreateStatic> class MAPNIK_EXP singleton + template class CreatePolicy=CreateStatic> class MAPNIK_DECL singleton { +#else +template class CreatePolicy=CreateStatic> class singleton +{ +#endif + #ifdef __SUNPRO_CC /* Sun's C++ compiler will issue the following errors if CreatePolicy is used: Error: A class template name was expected instead of mapnik::CreatePolicy