Author vstinner
Recipients erikjanss, eryksun, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2019-05-21.11:17:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558437461.25.0.0851819305651.issue36965@roundup.psfhosted.org>
In-reply-to
Content
> WIN32_LEAN_AND_MEAN is defined by Include/internal/pycore_condvar.h (...)

It would be nice to get ride of #include <windows.h> in Python headers. The <windows.h> was introduced by this commit:

commit 2ebc5ce42a8a9e047e790aefbf9a94811569b2b6
Author: Eric Snow <ericsnowcurrently@gmail.com>
Date:   Thu Sep 7 23:51:28 2017 -0600

    bpo-30860: Consolidate stateful runtime globals. (#3397)
    
    * group the (stateful) runtime globals into various topical structs
    * consolidate the topical structs under a single top-level _PyRuntimeState struct
    * add a check-c-globals.py script that helps identify runtime globals
    
    Other globals are excluded (see globals.txt and check-c-globals.py).

The current problem is that we need the HANDLE type which comes from <windows.h> to get the full structure:

typedef struct _PyCOND_T
{
    HANDLE sem;
    int waiting; /* to allow PyCOND_SIGNAL to be a no-op */
} PyCOND_T;

I tried to avoid "HANDLE" using:

typedef struct _PyCOND_T
{
    void* sem;
    int waiting; /* to allow PyCOND_SIGNAL to be a no-op */
} PyCOND_T;

... but then pycore_condvar.h compilation fails on "typedef CRITICAL_SECTION PyMUTEX_T;": CRITICAL_SECTION type is not defined :-(

By the way, Python still uses _PY_EMULATED_WIN_CV by default, whereas we want to drop Vista support: bpo-32592.
History
Date User Action Args
2019-05-21 11:17:41vstinnersetrecipients: + vstinner, paul.moore, tim.golden, zach.ware, eryksun, steve.dower, erikjanss
2019-05-21 11:17:41vstinnersetmessageid: <1558437461.25.0.0851819305651.issue36965@roundup.psfhosted.org>
2019-05-21 11:17:41vstinnerlinkissue36965 messages
2019-05-21 11:17:41vstinnercreate