Skip to content

Commit d4aacd3

Browse files
committed
gh-85283: Fix _ctypes_test build on Windows in release mode
Define Py_BUILD_CORE to not attempt to link the extension to python3.lib (which fails).
1 parent 0f9d0fb commit d4aacd3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Modules/_ctypes/_ctypes_test.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
// Need limited C API version 3.13 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
22
#define Py_LIMITED_API 0x030d0000
33

4+
// On Windows, Py_LIMITED_API requires Py_BUILD_CORE to not attempt linking the
5+
// stdlib extension to python3.lib (which fails). Then Python.h undefines
6+
// Py_BUILD_CORE when Py_LIMITED_API is defined.
7+
#define Py_BUILD_CORE
8+
49
#include <Python.h>
510

611
#include <stdio.h> // printf()

0 commit comments

Comments
 (0)