FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-41111: Move the Py_LIMITED_API macro of xxlimited module from setup.py to xxlimited.c. by shihai1991 · Pull Request #25115 · python/cpython · GitHub

/ cpython Public
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (2) .py  (1) .vcxproj  (2) All 3 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 4 additions & 0 deletions Modules/xxlimited.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
pass
*/

/* xxlimited with the limited API. */
#ifdef WITH_Py_LIMITED_API
# define Py_LIMITED_API 0x030a0000
#endif
#include "Python.h"

// Module state
Expand Down
4 changes: 4 additions & 0 deletions Modules/xxlimited_35.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

/* Xxo objects */

/* xxlimited_35 with the limited API. */
#ifdef WITH_Py_LIMITED_API
# define Py_LIMITED_API 0x03050000
#endif
#include "Python.h"

static PyObject *ErrorObject;
Expand Down
2 changes: 1 addition & 1 deletion PCbuild/xxlimited.vcxproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);Py_LIMITED_API=0x030A0000</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);WITH_Py_LIMITED_API=1</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
Expand Down
2 changes: 1 addition & 1 deletion PCbuild/xxlimited_35.vcxproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);Py_LIMITED_API=0x03060000</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);WITH_Py_LIMITED_API=1</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
Expand Down
4 changes: 2 additions & 2 deletions setup.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1867,9 +1867,9 @@ def detect_modules(self):
if 'd' not in sysconfig.get_config_var('ABIFLAGS'):
# Non-debug mode: Build xxlimited with limited API
self.add(Extension('xxlimited', ['xxlimited.c'],
define_macros=[('Py_LIMITED_API', '0x030a0000')]))
define_macros=[('WITH_Py_LIMITED_API', 1)]))
self.add(Extension('xxlimited_35', ['xxlimited_35.c'],
define_macros=[('Py_LIMITED_API', '0x03050000')]))
define_macros=[('WITH_Py_LIMITED_API', 1)]))
else:
# Debug mode: Build xxlimited with the full API
# (which is compatible with the limited one)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hum, I'm disappointed that CPython doesn't even support its own stable ABI in debug mode. So I created https://bugs.python.org/issue43688 to also support the limited C API in debug mode.

Expand Down

Back | FazBrowse Home | New Git URL