]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
cpython: fix build with Python 3.11
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Wed, 21 Sep 2022 15:21:58 +0000 (22:21 +0700)
committerMatthias Runge <mrunge@matthias-runge.de>
Wed, 26 Oct 2022 15:13:13 +0000 (17:13 +0200)
Python 3.11 moves longintrepr.h into cpython sub-directory.
However, in this version, longintrepr.h is always included.

src/cpython.h

index 11e64fa62f20850c450b8d1362d7f6a5c0a67037..bcfa406febfdf61f1f11dcd5535f2659f589abe8 100644 (file)
  *   Sven Trenkel <collectd at semidefinite.de>
  **/
 
+#include <Python.h>
 /* Some python versions don't include this by default. */
-
+#if PY_VERSION_HEX < 0x030B0000
+/*
+ * Python 3.11 move longintrepr.h to cpython/longintrepr.h
+ * And it's always included
+ */
 #include <longintrepr.h>
+#endif /* PY_VERSION_HEX < 0x030B0000 */
 
 /* These two macros are basically Py_BEGIN_ALLOW_THREADS and
  * Py_BEGIN_ALLOW_THREADS