diff --git a/gen_wrap.py b/gen_wrap.py index e3ffb0a20d208a2168b523ef59cdc21e4df03bf6..a9b43c8c62e52a896b530fe775e71aa60a3230d6 100644 --- a/gen_wrap.py +++ b/gen_wrap.py @@ -507,7 +507,13 @@ def get_callback(cb_name, cb): %(body)s py::object retval = py_cb(%(passed_args)s); if (retval.ptr() == Py_None) - return isl_stat_ok; + { + #if !defined(ISLPY_ISL_VERSION) || (ISLPY_ISL_VERSION >= 15) + return isl_stat_ok; + #else + return 0; + #endif + } else return py::extract<%(ret_type)s>(retval); } @@ -516,7 +522,11 @@ def get_callback(cb_name, cb): std::cout << "[islpy warning] A Python exception occurred in " "a call back function, ignoring:" << std::endl; PyErr_Print(); - return isl_stat_error; + #if !defined(ISLPY_ISL_VERSION) || (ISLPY_ISL_VERSION >= 15) + return isl_stat_error; + #else + return -1; + #endif } catch (std::exception &e) { @@ -524,7 +534,11 @@ def get_callback(cb_name, cb): "a Python callback query:" << std::endl << e.what() << std::endl; std::cout << "[islpy] Aborting now." << std::endl; - return isl_stat_error; + #if !defined(ISLPY_ISL_VERSION) || (ISLPY_ISL_VERSION >= 15) + return isl_stat_error; + #else + return -1; + #endif } } """ % dict( @@ -826,7 +840,11 @@ def write_wrapper(outf, meth): if meth.return_base_type in ["int", "isl_stat"] and not meth.return_ptr: body.append(""" - if (result == isl_stat_error) + #if !defined(ISLPY_ISL_VERSION) || (ISLPY_ISL_VERSION >= 15) + if (result == isl_stat_error) + #else + if (result == -1) + #endif { throw isl::error("call to isl_%(cls)s_%(name)s failed"); }""" % {"cls": meth.cls, "name": meth.name}) diff --git a/isl b/isl index 34a816af373253fca8dfd0f69a5424f02895af64..3916fbc5f0bab03d03ab886dde3fa4328a113af6 160000 --- a/isl +++ b/isl @@ -1 +1 @@ -Subproject commit 34a816af373253fca8dfd0f69a5424f02895af64 +Subproject commit 3916fbc5f0bab03d03ab886dde3fa4328a113af6 diff --git a/src/wrapper/wrap_isl.cpp b/src/wrapper/wrap_isl.cpp index 483ea9f01e39596bf23c8fecb1d939b479f7b201..fbea3eee2202bd63b8f0f56d343e8b58ed3d1d58 100644 --- a/src/wrapper/wrap_isl.cpp +++ b/src/wrapper/wrap_isl.cpp @@ -54,6 +54,7 @@ BOOST_PYTHON_MODULE(_isl) } */ +#if !defined(ISLPY_ISL_VERSION) || (ISLPY_ISL_VERSION >= 15) py::enum_("error") .ENUM_VALUE(isl_error_, none) .ENUM_VALUE(isl_error_, abort) @@ -67,6 +68,7 @@ BOOST_PYTHON_MODULE(_isl) .ENUM_VALUE(isl_stat_, error) .ENUM_VALUE(isl_stat_, ok) ; +#endif py::enum_("dim_type") .ENUM_VALUE(isl_dim_, cst) diff --git a/src/wrapper/wrap_isl.hpp b/src/wrapper/wrap_isl.hpp index 47e244ac68bc4149254f1bbfa28f3bd8f2a839a9..e852589c459710c0dda880730e1d0787a78f4df0 100644 --- a/src/wrapper/wrap_isl.hpp +++ b/src/wrapper/wrap_isl.hpp @@ -16,7 +16,9 @@ #include #include #include +#if !defined(ISLPY_ISL_VERSION) || (ISLPY_ISL_VERSION >= 15) #include +#endif #include #include #include