Changeset: 0d6c35b2fd57 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0d6c35b2fd57
Modified Files:
sql/backends/monet5/UDF/pyapi3/type_conversion3.c
Branch: Sep2022
Log Message:
Get to compile with Python 3.11.
diffs (30 lines):
diff --git a/sql/backends/monet5/UDF/pyapi3/type_conversion3.c
b/sql/backends/monet5/UDF/pyapi3/type_conversion3.c
--- a/sql/backends/monet5/UDF/pyapi3/type_conversion3.c
+++ b/sql/backends/monet5/UDF/pyapi3/type_conversion3.c
@@ -10,7 +10,11 @@
#include "type_conversion.h"
#include "unicode.h"
+#if PY_MINOR_VERSION >= 11
+#include <cpython/longintrepr.h>
+#else
#include <longintrepr.h>
+#endif
bool pyapi3_string_copy(const char *source, char *dest, size_t max_size, bool
allow_unicode)
{
@@ -51,8 +55,13 @@ PyObject *PyLong_FromHge(hge h)
prev = prev - ((prev >> (PyLong_SHIFT * i)) << (PyLong_SHIFT *
i));
z->ob_digit[i] = result;
}
- if (h < 0)
+ if (h < 0) {
+#if PY_MINOR_VERSION >= 9
+ Py_SET_SIZE(z, -Py_SIZE(z));
+#else
Py_SIZE(z) = -(Py_SIZE(z));
+#endif
+ }
return (PyObject *)z;
}
#endif
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]