Skip to content

Commit 12a842c

Browse files
committed
pythongh-108765: Python.h no longer includes <sys/time.h>
1 parent 45b9e6a commit 12a842c

File tree

6 files changed

+16
-20
lines changed

6 files changed

+16
-20
lines changed

Include/pyport.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -190,25 +190,6 @@ typedef Py_ssize_t Py_ssize_clean_t;
190190

191191
#include <math.h> /* Moved here from the math section, before extern "C" */
192192

193-
/********************************************
194-
* WRAPPER FOR <time.h> and/or <sys/time.h> *
195-
********************************************/
196-
197-
#ifdef HAVE_SYS_TIME_H
198-
#include <sys/time.h>
199-
#endif
200-
#include <time.h>
201-
202-
/******************************
203-
* WRAPPER FOR <sys/select.h> *
204-
******************************/
205-
206-
/* NB caller must include <sys/types.h> */
207-
208-
#ifdef HAVE_SYS_SELECT_H
209-
#include <sys/select.h>
210-
#endif /* !HAVE_SYS_SELECT_H */
211-
212193
/*******************************
213194
* stat() and fstat() fiddling *
214195
*******************************/

Modules/_multiprocessing/semaphore.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
#include "multiprocessing.h"
1111

12+
#ifdef HAVE_SYS_TIME_H
13+
# include <sys/time.h> // gettimeofday()
14+
#endif
15+
1216
#ifdef HAVE_MP_SEMAPHORE
1317

1418
enum { RECURSIVE_MUTEX, SEMAPHORE };

Modules/posixmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757

5858
#include <stdio.h> // ctermid()
5959
#include <stdlib.h> // system()
60+
#ifdef HAVE_SYS_TIME_H
61+
# include <sys/time.h> // futimes()
62+
#endif
63+
6064

6165
/*
6266
* A number of APIs are available on macOS from a certain macOS version.

Modules/timemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "pycore_runtime.h" // _Py_ID()
88

99
#include <ctype.h>
10-
10+
#include <time.h> // clock()
1111
#ifdef HAVE_SYS_TIMES_H
1212
# include <sys/times.h>
1313
#endif

Modules/xxsubtype.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "Python.h"
2+
23
#include <stddef.h> // offsetof()
4+
#include <time.h> // clock()
35

46

57
PyDoc_STRVAR(xxsubtype__doc__,

Python/pytime.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#include "Python.h"
22
#include "pycore_time.h" // _PyTime_t
3+
4+
#include <time.h> // gmtime_r() on Windows
5+
#ifdef HAVE_SYS_TIME_H
6+
# include <sys/time.h> // gettimeofday()
7+
#endif
38
#ifdef MS_WINDOWS
49
# include <winsock2.h> // struct timeval
510
#endif

0 commit comments

Comments
 (0)