1
0
mirror of https://github.com/postgres/postgres.git synced 2026-01-26 09:41:40 +03:00

Enable Python Limited API for PL/Python on MSVC

Previously, the Python Limited API was disabled on MSVC due to build
failures caused by Meson not knowing to link against python3.lib
instead of python3XX.lib when using the Limited API.

This commit works around the Meson limitation by explicitly finding
and linking against python3.lib on MSVC, and removes the preprocessor
guard that was disabling the Limited API on MSVC in plpython.h.

This requires python3.lib to be present in the Python installation,
which is included when Python is installed.

Author: Bryan Green <dbryan.green@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/ee410de1-1e0b-4770-b125-eeefd4726a24%40eisentraut.org
This commit is contained in:
Peter Eisentraut
2026-01-14 10:17:36 +01:00
parent 4196d6178a
commit 2bc60f8621
2 changed files with 15 additions and 5 deletions

View File

@@ -25,12 +25,8 @@
/*
* Enable Python Limited API
*
* XXX currently not enabled on MSVC because of build failures
*/
#if !defined(_MSC_VER)
#define Py_LIMITED_API 0x03020000
#endif
/*
* Pull in Python headers via a wrapper header, to control the scope of