From f1c19031fd5f4cf6faad539e30796b42954527db Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 10 Sep 2019 11:37:59 +0100 Subject: bpo-38068: Clean up gettimeofday configure logic. (GH-15775) Assume gettimeofday exists and takes two arguments. --- Python/pytime.c | 4 ---- Python/thread_pthread.h | 9 +-------- 2 files changed, 1 insertion(+), 12 deletions(-) (limited to 'Python') diff --git a/Python/pytime.c b/Python/pytime.c index 9ff300699f..54ddfc952b 100644 --- a/Python/pytime.c +++ b/Python/pytime.c @@ -718,11 +718,7 @@ pygettimeofday(_PyTime_t *tp, _Py_clock_info_t *info, int raise) #else /* HAVE_CLOCK_GETTIME */ /* test gettimeofday() */ -#ifdef GETTIMEOFDAY_NO_TZ - err = gettimeofday(&tv); -#else err = gettimeofday(&tv, (struct timezone *)NULL); -#endif if (err) { if (raise) { PyErr_SetFromErrno(PyExc_OSError); diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 5678b05ced..b9a340530c 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -97,17 +97,10 @@ #endif -/* We assume all modern POSIX systems have gettimeofday() */ -#ifdef GETTIMEOFDAY_NO_TZ -#define GETTIMEOFDAY(ptv) gettimeofday(ptv) -#else -#define GETTIMEOFDAY(ptv) gettimeofday(ptv, (struct timezone *)NULL) -#endif - #define MICROSECONDS_TO_TIMESPEC(microseconds, ts) \ do { \ struct timeval tv; \ - GETTIMEOFDAY(&tv); \ + gettimeofday(&tv, NULL); \ tv.tv_usec += microseconds % 1000000; \ tv.tv_sec += microseconds / 1000000; \ tv.tv_sec += tv.tv_usec / 1000000; \ -- cgit v1.2.1