diff options
author | Erlend E. Aasland <erlend.aasland@protonmail.com> | 2023-06-01 11:37:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-01 11:37:40 (GMT) |
commit | 9ab587b7146618866cee52c220aecf7bd5b44b02 (patch) | |
tree | f08fac8ec42d0c0ce92655ea5bd6185bfd7b46d1 /Modules | |
parent | 76b9c0cfaa3062a7f649d60cea653173d12d3839 (diff) | |
download | cpython-9ab587b7146618866cee52c220aecf7bd5b44b02.zip cpython-9ab587b7146618866cee52c220aecf7bd5b44b02.tar.gz cpython-9ab587b7146618866cee52c220aecf7bd5b44b02.tar.bz2 |
gh-89886: Rely on HAVE_SYS_TIME_H (#105058)
Quoting autoconf (v2.71):
All current systems provide time.h; it need not be checked for.
Not all systems provide sys/time.h, but those that do, all allow
you to include it and time.h simultaneously.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/readline.c | 3 | ||||
-rw-r--r-- | Modules/resource.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Modules/readline.c b/Modules/readline.c index fdb6356..2824105 100644 --- a/Modules/readline.c +++ b/Modules/readline.c @@ -11,7 +11,10 @@ #include <signal.h> #include <stddef.h> #include <stdlib.h> // free() +#ifdef HAVE_SYS_TIME_H #include <sys/time.h> +#endif +#include <time.h> #if defined(HAVE_SETLOCALE) /* GNU readline() mistakenly sets the LC_CTYPE locale. diff --git a/Modules/resource.c b/Modules/resource.c index 2a8158c..3c89468c 100644 --- a/Modules/resource.c +++ b/Modules/resource.c @@ -1,7 +1,10 @@ #include "Python.h" #include <sys/resource.h> +#ifdef HAVE_SYS_TIME_H #include <sys/time.h> +#endif +#include <time.h> #include <string.h> #include <errno.h> #include <unistd.h> |