mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +00:00
Support swig 4.5 (#9324)
Current swig has removed support for python2 macros, breaking the build. See: https://github.com/swig/swig/blob/5872e9b4176cf59ce4e31b010c29a4cebf32960f/CHANGES#L391
This commit is contained in:
@@ -161,7 +161,7 @@
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
int cast_pyobject(PyObject* element) {
|
int cast_pyobject(PyObject* element) {
|
||||||
return static_cast<int>(PyInt_AsLong(element));
|
return static_cast<int>(PyLong_AsLong(element));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
@@ -255,9 +255,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject* pythonize(const int& t) { return PyInt_FromLong(t); }
|
PyObject* pythonize(const int& t) { return PyLong_FromLong(t); }
|
||||||
PyObject* pythonize(const int64_t& t) { return PyLong_FromLongLong(t); }
|
PyObject* pythonize(const int64_t& t) { return PyLong_FromLongLong(t); }
|
||||||
PyObject* pythonize(const unsigned int& t) { return PyInt_FromLong(t); }
|
PyObject* pythonize(const unsigned int& t) { return PyLong_FromLong(t); }
|
||||||
PyObject* pythonize(const bool& t) { return PyBool_FromLong(t); }
|
PyObject* pythonize(const bool& t) { return PyBool_FromLong(t); }
|
||||||
PyObject* pythonize(const boost::logic::tribool& t) { return boost::logic::indeterminate(t) ? PyUnicode_FromString("UNKNOWN") : PyBool_FromLong((bool)t) ;}
|
PyObject* pythonize(const boost::logic::tribool& t) { return boost::logic::indeterminate(t) ? PyUnicode_FromString("UNKNOWN") : PyBool_FromLong((bool)t) ;}
|
||||||
PyObject* pythonize(const double& t) { return PyFloat_FromDouble(t); }
|
PyObject* pythonize(const double& t) { return PyFloat_FromDouble(t); }
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
%typemap(out) ifcopenshell::argument_type {
|
%typemap(out) ifcopenshell::argument_type {
|
||||||
$result = SWIG_Python_str_FromChar(ifcopenshell::argument_type_to_string($1));
|
$result = PyUnicode_FromString(ifcopenshell::argument_type_to_string($1));
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(out) ifcopenshell::declaration* {
|
%typemap(out) ifcopenshell::declaration* {
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
%typemap(out) ifcopenshell::simple_type::data_type {
|
%typemap(out) ifcopenshell::simple_type::data_type {
|
||||||
static const char* const data_type_strings[] = {"binary", "boolean", "integer", "logical", "number", "real", "string"};
|
static const char* const data_type_strings[] = {"binary", "boolean", "integer", "logical", "number", "real", "string"};
|
||||||
$result = SWIG_Python_str_FromChar(data_type_strings[(int)$1]);
|
$result = PyUnicode_FromString(data_type_strings[(int)$1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(out) attribute_value {
|
%typemap(out) attribute_value {
|
||||||
|
|||||||
Reference in New Issue
Block a user