diff --git a/Include/pyport.h b/Include/pyport.h index 511c3fda1a40a5..f47a79542e0d98 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -190,25 +190,6 @@ typedef Py_ssize_t Py_ssize_clean_t; #include /* Moved here from the math section, before extern "C" */ -/******************************************** - * WRAPPER FOR and/or * - ********************************************/ - -#ifdef HAVE_SYS_TIME_H -#include -#endif -#include - -/****************************** - * WRAPPER FOR * - ******************************/ - -/* NB caller must include */ - -#ifdef HAVE_SYS_SELECT_H -#include -#endif /* !HAVE_SYS_SELECT_H */ - /******************************* * stat() and fstat() fiddling * *******************************/ diff --git a/Modules/_multiprocessing/semaphore.c b/Modules/_multiprocessing/semaphore.c index d22b8d18e33e42..f8f2afda28d06d 100644 --- a/Modules/_multiprocessing/semaphore.c +++ b/Modules/_multiprocessing/semaphore.c @@ -9,6 +9,10 @@ #include "multiprocessing.h" +#ifdef HAVE_SYS_TIME_H +# include // gettimeofday() +#endif + #ifdef HAVE_MP_SEMAPHORE enum { RECURSIVE_MUTEX, SEMAPHORE }; diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 0436571abc9054..62c99e3bfe24ef 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -57,6 +57,10 @@ #include // ctermid() #include // system() +#ifdef HAVE_SYS_TIME_H +# include // futimes() +#endif + /* * A number of APIs are available on macOS from a certain macOS version. diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 68948b6be1a61a..4e55da71b117ca 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -7,7 +7,7 @@ #include "pycore_runtime.h" // _Py_ID() #include - +#include // clock() #ifdef HAVE_SYS_TIMES_H # include #endif diff --git a/Modules/xxsubtype.c b/Modules/xxsubtype.c index 63b22268c597b6..560f43e5b3a643 100644 --- a/Modules/xxsubtype.c +++ b/Modules/xxsubtype.c @@ -1,5 +1,7 @@ #include "Python.h" + #include // offsetof() +#include // clock() PyDoc_STRVAR(xxsubtype__doc__, diff --git a/Python/pytime.c b/Python/pytime.c index 49cd5f4e8ea617..77f7e9ecbd840e 100644 --- a/Python/pytime.c +++ b/Python/pytime.c @@ -1,5 +1,10 @@ #include "Python.h" #include "pycore_time.h" // _PyTime_t + +#include // gmtime_r() on Windows +#ifdef HAVE_SYS_TIME_H +# include // gettimeofday() +#endif #ifdef MS_WINDOWS # include // struct timeval #endif