From ed5bbe25fef2c6a1a169e1fe3766a19f1da1b7db Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Wed, 17 Jan 2007 11:43:11 +0000 Subject: [PATCH] improved win32 support from Valery Moiseev. --- include/mapnik/config.hpp | 22 +++++++++++++------ include/mapnik/datasource.hpp | 6 ++--- include/mapnik/geom_util.hpp | 6 ++--- include/mapnik/image_util.hpp | 10 +-------- include/mapnik/load_map.hpp | 2 +- include/mapnik/save_map.hpp | 2 +- plugins/input/shape/shape.hpp | 2 +- plugins/input/shape/shape_featureset.hpp | 2 +- .../input/shape/shape_index_featureset.hpp | 2 +- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/mapnik/config.hpp b/include/mapnik/config.hpp index 857ebf5c9..c057d655a 100644 --- a/include/mapnik/config.hpp +++ b/include/mapnik/config.hpp @@ -26,14 +26,22 @@ // Windows DLL support #ifdef _WINDOWS -# define MAPNIK_DECL __declspec (dllexport) -# pragma warning( disable: 4251 ) -# pragma warning( disable: 4275 ) -# if (_MSC_VER >= 1400) // vc8 -# pragma warning(disable : 4996) //_CRT_SECURE_NO_DEPRECATE -# endif +# define MAPNIK_EXP __declspec (dllexport) +# define MAPNIK_IMP __declspec (dllimport) +# ifdef MAPNIK_EXPORTS +# define MAPNIK_DECL __declspec (dllexport) +# else +# define MAPNIK_DECL __declspec (dllimport) +# endif +# pragma warning( disable: 4251 ) +# pragma warning( disable: 4275 ) +# if (_MSC_VER >= 1400) // vc8 +# pragma warning(disable : 4996) //_CRT_SECURE_NO_DEPRECATE +# endif #else -# define MAPNIK_DECL +# define MAPNIK_EXP +# define MAPNIK_IMP +# define MAPNIK_DECL #endif #endif // CONFIG_HPP diff --git a/include/mapnik/datasource.hpp b/include/mapnik/datasource.hpp index 770f5f92e..9ee41f81b 100644 --- a/include/mapnik/datasource.hpp +++ b/include/mapnik/datasource.hpp @@ -108,15 +108,15 @@ namespace mapnik { #define DATASOURCE_PLUGIN(classname) \ - extern "C" MAPNIK_DECL std::string datasource_name() \ + extern "C" MAPNIK_EXP std::string datasource_name() \ { \ return classname::name(); \ } \ - extern "C" MAPNIK_DECL datasource* create(const parameters ¶ms) \ + extern "C" MAPNIK_EXP datasource* create(const parameters ¶ms) \ { \ return new classname(params); \ } \ - extern "C" MAPNIK_DECL void destroy(datasource *ds) \ + extern "C" MAPNIK_EXP void destroy(datasource *ds) \ { \ delete ds; \ } \ diff --git a/include/mapnik/geom_util.hpp b/include/mapnik/geom_util.hpp index 98debd5c1..d6b04cf5f 100644 --- a/include/mapnik/geom_util.hpp +++ b/include/mapnik/geom_util.hpp @@ -148,7 +148,7 @@ namespace mapnik { double len2 = distance2(ax,ay,bx,by); - if (len2 < 1e-7) + if (len2 < 1e-14) { return distance(x,y,ax,ay); } @@ -172,7 +172,7 @@ namespace mapnik double x0=boost::get<0>(*start); double y0=boost::get<1>(*start); double x1,y1; - while (++start!=end) + while (++start != end) { if ( boost::get<2>(*start) == SEG_MOVETO) { @@ -184,7 +184,7 @@ namespace mapnik y1=boost::get<1>(*start); double distance = point_to_segment_distance(x,y,x0,y0,x1,y1); - if (distance < tol) + if (distance < tol) return true; x0=x1; y0=y1; diff --git a/include/mapnik/image_util.hpp b/include/mapnik/image_util.hpp index ce80a1529..e293967c8 100644 --- a/include/mapnik/image_util.hpp +++ b/include/mapnik/image_util.hpp @@ -33,19 +33,11 @@ namespace mapnik { - template + template MAPNIK_DECL void save_to_file(std::string const& filename, std::string const& type, T const& image); - template - void save_as_png(std::string const& filename, - Image32 const& image); - template - void save_as_jpeg(std::string const& filename, - int quality, - T const& image); - template double distance(T x0,T y0,T x1,T y1) diff --git a/include/mapnik/load_map.hpp b/include/mapnik/load_map.hpp index 48f9025bb..d93c9878d 100644 --- a/include/mapnik/load_map.hpp +++ b/include/mapnik/load_map.hpp @@ -29,7 +29,7 @@ namespace mapnik { - void load_map(Map & map, std::string const& filename); + MAPNIK_DECL void load_map(Map & map, std::string const& filename); } #endif // LOAD_MAP_HPP diff --git a/include/mapnik/save_map.hpp b/include/mapnik/save_map.hpp index f1699a862..9de170226 100644 --- a/include/mapnik/save_map.hpp +++ b/include/mapnik/save_map.hpp @@ -30,7 +30,7 @@ namespace mapnik { - void save_map(Map const& map, std::string const& filename); + MAPNIK_DECL void save_map(Map const& map, std::string const& filename); } #endif // SAVE_MAP_HPP diff --git a/plugins/input/shape/shape.hpp b/plugins/input/shape/shape.hpp index 866e96a95..bfb9bebcf 100644 --- a/plugins/input/shape/shape.hpp +++ b/plugins/input/shape/shape.hpp @@ -32,7 +32,7 @@ using namespace mapnik; -class MAPNIK_DECL shape_datasource : public datasource +class shape_datasource : public datasource { public: shape_datasource(const parameters ¶ms); diff --git a/plugins/input/shape/shape_featureset.hpp b/plugins/input/shape/shape_featureset.hpp index 10e875980..af74a94e6 100644 --- a/plugins/input/shape/shape_featureset.hpp +++ b/plugins/input/shape/shape_featureset.hpp @@ -29,7 +29,7 @@ using namespace mapnik; template -class MAPNIK_DECL shape_featureset : public Featureset +class shape_featureset : public Featureset { filterT filter_; int shape_type_; diff --git a/plugins/input/shape/shape_index_featureset.hpp b/plugins/input/shape/shape_index_featureset.hpp index 9cb13ee69..33302216f 100644 --- a/plugins/input/shape/shape_index_featureset.hpp +++ b/plugins/input/shape/shape_index_featureset.hpp @@ -29,7 +29,7 @@ #include "shape_featureset.hpp" template -class MAPNIK_DECL shape_index_featureset : public Featureset +class shape_index_featureset : public Featureset { filterT filter_; int shape_type_;