Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only #define PY_SSIZE_T_CLEAN if it is not already #defined #4104

Merged
merged 1 commit into from Apr 8, 2021

Conversation

aytey
Copy link
Contributor

@aytey aytey commented Apr 8, 2021

For something I use Cython for, we do not use setup.py or anything like that, but add the output of Cython (i.e., the .c files) to our CMakeLists.txt.

However, for the rest of the code in our project, we already have PY_SSIZE_T_CLEAN set as a compile-time define (e.g., with add_definitions(-DPY_SSIZE_T_CLEAN). This causes us an issue when we're compiling the output of Cython, as we get a warning (which becomes an error with -Werror) related to PY_SSIZE_T_CLEAN.

This PR changes Cython such that PY_SSIZE_T_CLEAN is only defined in the Cython-generated code, if it is not already defined.

Signed-off-by: Andrew V. Jones andrew.jones@vector.com

Signed-off-by: Andrew V. Jones <andrew.jones@vector.com>
@aytey aytey force-pushed the conditional_ssize_t_clean branch from ce8a1c9 to 3ccd947 Compare April 8, 2021 14:05
@robertwb robertwb merged commit efdf996 into cython:master Apr 8, 2021
@scoder scoder added this to the 0.29.23 milestone Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants