From 94ae30d7a2aceb699f002bdd3a08ab4cfc484865 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 5 Jan 2012 16:45:12 -0800 Subject: [PATCH] fix compile with older boost - fixes #1007 --- bindings/python/mapnik_geometry.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bindings/python/mapnik_geometry.cpp b/bindings/python/mapnik_geometry.cpp index 2f94594de..13077e95b 100644 --- a/bindings/python/mapnik_geometry.cpp +++ b/bindings/python/mapnik_geometry.cpp @@ -89,9 +89,9 @@ inline std::string boost_version() return s.str(); } +#if BOOST_VERSION >= 104700 PyObject* to_wkb( geometry_type const& geom, mapnik::util::wkbByteOrder byte_order) { -#if BOOST_VERSION >= 104700 mapnik::util::wkb_buffer_ptr wkb = mapnik::util::to_wkb(geom,byte_order); return #if PY_VERSION_HEX >= 0x03000000 @@ -100,16 +100,19 @@ PyObject* to_wkb( geometry_type const& geom, mapnik::util::wkbByteOrder byte_ord ::PyString_FromStringAndSize #endif ((const char*)wkb->buffer(),wkb->size()); +} #else +PyObject* to_wkb( geometry_type const& geom) +{ throw std::runtime_error("mapnik::to_wkb() requires at least boost 1.47 while your build was compiled against boost " + boost_version()); -#endif } +#endif +#if BOOST_VERSION >= 104700 PyObject* to_wkb2( path_type const& p, mapnik::util::wkbByteOrder byte_order) { -#if BOOST_VERSION >= 104700 mapnik::util::wkb_buffer_ptr wkb = mapnik::util::to_wkb(p,byte_order); return #if PY_VERSION_HEX >= 0x03000000 @@ -118,11 +121,14 @@ PyObject* to_wkb2( path_type const& p, mapnik::util::wkbByteOrder byte_order) ::PyString_FromStringAndSize #endif ((const char*)wkb->buffer(),wkb->size()); +} #else +PyObject* to_wkb2( path_type const& p) +{ throw std::runtime_error("mapnik::to_wkb() requires at least boost 1.47 while your build was compiled against boost " + boost_version()); -#endif } +#endif std::string to_wkt( geometry_type const& geom)