Skip to content

Commit f65767a

Browse files
committed
PY3 - add support for buliding PyCAIRO support (ref #3438)
1 parent e2bbfa6 commit f65767a

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/mapnik_image.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@
4343
#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO)
4444
#include <mapnik/cairo/cairo_context.hpp>
4545
#include <mapnik/cairo/cairo_image_util.hpp>
46+
#if PY_MAJOR_VERSION >= 3
47+
#include <py3cairo.h>
48+
#else
4649
#include <pycairo.h>
50+
#endif
4751
#include <cairo.h>
4852
#endif
4953

src/mapnik_python.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,13 @@ void clear_cache()
142142
#if defined(HAVE_PYCAIRO)
143143
#include <boost/python/type_id.hpp>
144144
#include <boost/python/converter/registry.hpp>
145+
#if PY_MAJOR_VERSION >= 3
146+
#include <py3cairo.h>
147+
#else
145148
#include <pycairo.h>
146149
static Pycairo_CAPI_t *Pycairo_CAPI;
150+
#endif
151+
147152
static void *extract_surface(PyObject* op)
148153
{
149154
if (PyObject_TypeCheck(op, const_cast<PyTypeObject*>(Pycairo_CAPI->Surface_Type)))

0 commit comments

Comments
 (0)