From a8eadfccfd376321180849e452bb6dc340a6028e Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 22 Feb 2024 16:27:21 +0000 Subject: [PATCH] Issue #12 add pre-processor commands to build on python 3.12 (#44) --- ndicapimodule.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ndicapimodule.cxx b/ndicapimodule.cxx index ecabbd6..022ad7d 100644 --- a/ndicapimodule.cxx +++ b/ndicapimodule.cxx @@ -26,7 +26,11 @@ #define PyString_AsString PyUnicode_AsUTF8 #define PyIntObject PyLongObject //#define PY_INT_OBJECT_OB_IVAL(ob) PyLong_AsLong((PyObject*)(ob)) - #define PY_INT_OBJECT_OB_IVAL(ob) ob->ob_digit[0] + #if PY_MINOR_VERSION < 12 + #define PY_INT_OBJECT_OB_IVAL(ob) ob->ob_digit[0] + #else + #define PY_INT_OBJECT_OB_IVAL(ob) ob->long_value.ob_digit[0] + #endif #define cmpfunc PyAsyncMethods* #else #define MOD_ERROR_VAL