Skip to content

Commit

Permalink
gh-85283: Fix _ctypes_test build on Windows in release mode
Browse files Browse the repository at this point in the history
Define Py_BUILD_CORE to not attempt to link the extension to
python3.lib (which fails).
  • Loading branch information
vstinner committed Oct 17, 2023
1 parent 0f9d0fb commit d4aacd3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Modules/_ctypes/_ctypes_test.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// Need limited C API version 3.13 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
#define Py_LIMITED_API 0x030d0000

// On Windows, Py_LIMITED_API requires Py_BUILD_CORE to not attempt linking the
// stdlib extension to python3.lib (which fails). Then Python.h undefines
// Py_BUILD_CORE when Py_LIMITED_API is defined.
#define Py_BUILD_CORE

#include <Python.h>

#include <stdio.h> // printf()
Expand Down

0 comments on commit d4aacd3

Please sign in to comment.