Author vstinner
Recipients erikjanss, eryksun, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2019-05-21.10:57:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
eryksun commented there, but I prefer to discuss here:

""Windows.h" was already being included, as I mentioned on the issue tracker, because we certainly were not getting STATUS_CONTROL_C_EXIT from "crtdbg.h", a header that was left in this file accidentally about 12 years ago. If it's included explicitly here, also define WIN32_LEAN_AND_MEAN to cut the number of included headers by about a half."

I prefer to explicitly include windows.h, it doesn't hurt :-)

WIN32_LEAN_AND_MEAN is defined by Include/internal/pycore_condvar.h which is indirectly included by pycore_pystate.h:

#include "pycore_gil.h"   /* _gil_runtime_state  */


#include "pycore_condvar.h"

By the way, WIN32_LEAN_AND_MEAN caused me issues while working on bpo-36728:

I managed to workaround the issue: commit d5d9e81ce9a7efc5bc14a5c21398d1ef6f626884

Extract of (fixed) posixmodule.c:
#include "Python.h"
   /* include <windows.h> early to avoid conflict with pycore_condvar.h:

        #define WIN32_LEAN_AND_MEAN
        #include <windows.h>

      FSCTL_GET_REPARSE_POINT is not exported with WIN32_LEAN_AND_MEAN. */
#  include <windows.h>

#include "pycore_ceval.h"     /* _PyEval_ReInitThreads() */
#include "pycore_pystate.h"   /* _PyRuntime */
Date User Action Args
2019-05-21 10:57:02vstinnersetrecipients: + vstinner, paul.moore, tim.golden, zach.ware, eryksun, steve.dower, erikjanss
2019-05-21 10:57:02vstinnersetmessageid: <>
2019-05-21 10:57:02vstinnerlinkissue36965 messages
2019-05-21 10:57:02vstinnercreate