-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Fix building CPython with -DWIN32_LEAN_AND_MEAN on Windows #115882
Comments
This allows the module to be compiled with WIN32_LEAN_AND_MEAN enabled
Most of these patches are likely to be innocuous, so they'll likely be merged with no problem (though not backported, as this is not a bug). However, I'd be interested to know what benefit you get from compiling with this flag set? It has no impact on the final result, so presumably you're seeing a performance improvement in building. Is it significant? |
@zooba, it looks like it was the only patch regarding WIN32_LEAN_AND_MEAN build (though not the only patch we apply in total). As for your question, having this CFLAG defined allows to reduce negative impact of tranisitive Windows SDK headers which tend to define various keywords as a macros (see protobuf solution for the case). As we are using our own build system to compile both python sources and our own code, we have simply defined this CFLAG universally. As for the guarantees from Microsoft — they do neither recommend nor discommend using this define (see here). Yet their documentation explicitly recommends including particular header instead of expecting |
To be clear, this is not an explicit recommendation, but an acknowledgement that this is the header file that contains the definition. In many such cases, an explicit recommendation is made to include Avoiding certain macros being defined is a perfectly good reason though. If this is the only one you need, glad to have been able to help. |
…15350) This allows the module to be compiled with WIN32_LEAN_AND_MEAN enabled
…15350) This allows the module to be compiled with WIN32_LEAN_AND_MEAN enabled
…15350) This allows the module to be compiled with WIN32_LEAN_AND_MEAN enabled
Feature or enhancement
Proposal:
We use customized build of CPython which compiles all the sources with
-WIN32_LEAN_AND_MEAN
, thus limiting the amount of transitive#include
fromWindows.h
header.I would like to propose a series of enhancements to make CPython buildable in this configuration.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: