gh-111506: Error if the limited API is used in free-threaded build (#117762)

Issue a build time error if both `Py_LIMITED_API` and `Py_GIL_DISABLED`
are defined.
This commit is contained in:
Sam Gross 2024-04-11 13:49:52 -04:00 committed by GitHub
parent c06be6bbb8
commit 39d381f91e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -45,6 +45,11 @@
# endif
#endif
// gh-111506: The free-threaded build is not compatible with the limited API
// or the stable ABI.
#if defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED)
# error "The limited API is not currently supported in the free-threaded build"
#endif
// Include Python header files
#include "pyport.h"