From 6a0ce99e22fa6bb4d61608cb2dec4000b71a65a6 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 20 Feb 2012 17:09:14 -0800 Subject: [PATCH] maintain compile with boost <= 1.47 --- src/json/geojson_generator.cpp | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/json/geojson_generator.cpp b/src/json/geojson_generator.cpp index 3732fc424..461f5b90f 100644 --- a/src/json/geojson_generator.cpp +++ b/src/json/geojson_generator.cpp @@ -20,6 +20,12 @@ * *****************************************************************************/ +// boost +#include +#include + +#if BOOST_VERSION >= 104700 + #include #include #include @@ -51,3 +57,37 @@ bool geometry_generator::generate(std::string & geojson, mapnik::geometry_contai } }} + +#else + +#include +#include +#include + +namespace mapnik { namespace json { + +class feature_generator { + public: + bool generate(std::string & geojson, mapnik::Feature const& f) + { + std::ostringstream s; + s << BOOST_VERSION/100000 << "." << BOOST_VERSION/100 % 1000 << "." << BOOST_VERSION % 100; + throw std::runtime_error("feature_generator::generate() requires at least boost 1.47 while your build was compiled against boost " + s.str()); + return false; + } +}; + +class geometry_generator { + public: + bool generate(std::string & geojson, mapnik::geometry_container const& g) + { + std::ostringstream s; + s << BOOST_VERSION/100000 << "." << BOOST_VERSION/100 % 1000 << "." << BOOST_VERSION % 100; + throw std::runtime_error("geometry_generator::generate() requires at least boost 1.47 while your build was compiled against boost " + s.str()); + return false; + } +}; + +}} + +#endif