diff options
author | Max Bachmann <oss@maxbachmann.de> | 2023-03-09 22:09:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-09 21:09:12 +0000 |
commit | c6858d1e7f4cd3184d5ddea4025ad5dfc7596546 (patch) | |
tree | 6c5261397eca871567bb29b31cfe02c92f6d3b58 /Modules/selectmodule.c | |
parent | ca066bdbed85094a9c4d9930823ce3587807db48 (diff) | |
download | cpython-git-c6858d1e7f4cd3184d5ddea4025ad5dfc7596546.tar.gz |
gh-102255: Improve build support for Windows API partitions (GH-102256)
Add `MS_WINDOWS_DESKTOP`, `MS_WINDOWS_APPS`, `MS_WINDOWS_SYSTEM` and `MS_WINDOWS_GAMES` preprocessor definitions to allow switching off functionality missing from particular API partitions ("partitions" are used in Windows to identify overlapping subsets of APIs).
CPython only officially supports `MS_WINDOWS_DESKTOP` and `MS_WINDOWS_SYSTEM` (APPS is included by normal desktop builds, but APPS without DESKTOP is not covered). Other configurations are a convenience for people building their own runtimes.
`MS_WINDOWS_GAMES` is for the Xbox subset of the Windows API, which is also available on client OS, but is restricted compared to `MS_WINDOWS_DESKTOP`. These restrictions may change over time, as they relate to the build headers rather than the OS support, and so we assume that Xbox builds will use the latest available version of the GDK.
Diffstat (limited to 'Modules/selectmodule.c')
-rw-r--r-- | Modules/selectmodule.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index df4043de08..5a1e40d0b4 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -57,8 +57,10 @@ extern void bzero(void *, int); #endif #ifdef MS_WINDOWS -# define WIN32_LEAN_AND_MEAN -# include <winsock.h> +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# include <winsock2.h> #else # define SOCKET int #endif |