Permalink
Browse files

fix compiler error with mapnik 2.1 or where mapnik::value_integer is …

…int32
  • Loading branch information...
1 parent b9b9ce4 commit 04b65ed94efaa83ed1d44698b5e830680e8f1229 @stefanklug stefanklug committed Dec 20, 2012
Showing with 11 additions and 13 deletions.
  1. +1 −1 src/mapnik_feature.cpp
  2. +1 −1 src/mapnik_map.cpp
  3. +1 −1 src/mapnik_memory_datasource.cpp
  4. +8 −10 src/utils.hpp
View
@@ -231,7 +231,7 @@ Handle<Value> Feature::addAttributes(const Arguments& args)
// todo - round
if (num == value->IntegerValue()) {
#if MAPNIK_VERSION >= 200100
- fp->get()->put_new(TOSTR(name),value->IntegerValue());
+ fp->get()->put_new(TOSTR(name),static_cast<node_mapnik::value_integer>(value->IntegerValue()));
#else
boost::put(*fp->get(),TOSTR(name),static_cast<int>(value->IntegerValue()));
#endif
View
@@ -430,7 +430,7 @@ void Map::set_prop(Local<String> property,
double num = value->NumberValue();
// todo - round
if (num == value->IntegerValue()) {
- params[TOSTR(name)] = value->IntegerValue();
+ params[TOSTR(name)] = static_cast<node_mapnik::value_integer>(value->IntegerValue());
} else {
double dub_val = value->NumberValue();
params[TOSTR(name)] = dub_val;
@@ -263,7 +263,7 @@ Handle<Value> MemoryDatasource::add(const Arguments& args)
// todo - round
if (num == value->IntegerValue()) {
#if MAPNIK_VERSION >= 200100
- feature->put_new(TOSTR(name),value->IntegerValue());
+ feature->put_new(TOSTR(name),static_cast<node_mapnik::value_integer>(value->IntegerValue()));
#else
boost::put(*feature,TOSTR(name),static_cast<int>(value->IntegerValue()));
#endif
View
@@ -40,6 +40,12 @@ using namespace v8;
using namespace node;
namespace node_mapnik {
+
+#if MAPNIK_VERSION >= 200200
+ typedef mapnik::value_integer value_integer;
+#else
+ typedef int value_integer;
+#endif
// adapted to work for both mapnik features and mapnik parameters
struct params_to_object : public boost::static_visitor<>
@@ -49,11 +55,7 @@ struct params_to_object : public boost::static_visitor<>
ds_(ds),
key_(key) {}
-#if MAPNIK_VERSION >= 200200
- void operator () ( mapnik::value_integer val )
-#else
- void operator () ( int val )
-#endif
+ void operator () ( value_integer val )
{
ds_->Set(String::NewSymbol(key_.c_str()), Integer::New(val) );
}
@@ -93,11 +95,7 @@ struct params_to_object : public boost::static_visitor<>
struct value_converter: public boost::static_visitor<Handle<Value> >
{
-#if MAPNIK_VERSION >= 200200
- Handle<Value> operator () ( mapnik::value_integer val ) const
-#else
- Handle<Value> operator () ( int val ) const
-#endif
+ Handle<Value> operator () ( value_integer val ) const
{
return Integer::New(val);
}

0 comments on commit 04b65ed

Please sign in to comment.