PyAPI: support building with the up-coming Python 3.12
- Account for new member in _PyArg_Parser. - Many Python op-codes have been removed. For the moment these are disabled in is_opcode_secure. Some should be added back as intrinsics, noted in code-comments.
This commit is contained in:
25
source/blender/python/generic/python_compat.h
Normal file
25
source/blender/python/generic/python_compat.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup pygen
|
||||
* \brief header-only compatibility defines.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Add `intialized` member for Python 3.12+. */
|
||||
#if PY_VERSION_HEX >= 0x030c0000
|
||||
# define PY_ARG_PARSER_HEAD_COMPAT() 0,
|
||||
#else
|
||||
# define PY_ARG_PARSER_HEAD_COMPAT()
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user