Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #132 from stefanklug/compiler-error

fix compiler error with mapnik 2.1 or where mapnik::value_integer is int...
  • Loading branch information...
commit 238aafa7f697e4ba90565ba5bbf7e23481d1c8a6 2 parents b9b9ce4 + 04b65ed
@springmeyer springmeyer authored
View
2  src/mapnik_feature.cpp
@@ -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
2  src/mapnik_map.cpp
@@ -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;
View
2  src/mapnik_memory_datasource.cpp
@@ -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
18 src/utils.hpp
@@ -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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.