Permalink
Browse files

improved win32 support from Valery Moiseev.

  • Loading branch information...
1 parent 5549045 commit ed5bbe25fef2c6a1a169e1fe3766a19f1da1b7db @artemp artemp committed Jan 17, 2007
@@ -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
@@ -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 &params) \
+ extern "C" MAPNIK_EXP datasource* create(const parameters &params) \
{ \
return new classname(params); \
} \
- extern "C" MAPNIK_DECL void destroy(datasource *ds) \
+ extern "C" MAPNIK_EXP void destroy(datasource *ds) \
{ \
delete ds; \
} \
@@ -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;
@@ -33,19 +33,11 @@
namespace mapnik {
- template <typename T>
+ template <typename T> MAPNIK_DECL
void save_to_file(std::string const& filename,
std::string const& type,
T const& image);
- template <typename T>
- void save_as_png(std::string const& filename,
- Image32 const& image);
- template <typename T>
- void save_as_jpeg(std::string const& filename,
- int quality,
- T const& image);
-
template <typename T>
double distance(T x0,T y0,T x1,T y1)
@@ -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
@@ -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
@@ -32,7 +32,7 @@
using namespace mapnik;
-class MAPNIK_DECL shape_datasource : public datasource
+class shape_datasource : public datasource
{
public:
shape_datasource(const parameters &params);
@@ -29,7 +29,7 @@
using namespace mapnik;
template <typename filterT>
-class MAPNIK_DECL shape_featureset : public Featureset
+class shape_featureset : public Featureset
{
filterT filter_;
int shape_type_;
@@ -29,7 +29,7 @@
#include "shape_featureset.hpp"
template <typename filterT>
-class MAPNIK_DECL shape_index_featureset : public Featureset
+class shape_index_featureset : public Featureset
{
filterT filter_;
int shape_type_;

0 comments on commit ed5bbe2

Please sign in to comment.