summaryrefslogtreecommitdiff
path: root/dev-python/line_profiler/files/line_profiler-3.0.2-python3_9.patch
blob: 74b0677bc70a68e66bf53436331bfd3f36be7376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From f40a6e102d3c4808155af601ddba7733e597e604 Mon Sep 17 00:00:00 2001
From: Stefano Rivera <stefano@rivera.za.net>
Date: Thu, 15 Oct 2020 22:44:50 -0700
Subject: [PATCH] Python 3.9 dropped gettimeofday configure checks

Upstream status: Accepted [https://github.com/pyutils/line_profiler/pull/31}
Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr>

diff --git a/line_profiler/timers.c b/line_profiler/timers.c
index ae01060..e8ee6c6 100644
--- a/line_profiler/timers.c
+++ b/line_profiler/timers.c
@@ -32,10 +32,6 @@ hpTimerUnit(void)
 
 #else  /* !MS_WINDOWS */
 
-#ifndef HAVE_GETTIMEOFDAY
-#error "This module requires gettimeofday() on non-Windows platforms!"
-#endif
-
 #if (defined(PYOS_OS2) && defined(PYCC_GCC))
 #include <sys/time.h>
 #else
@@ -48,11 +44,7 @@ hpTimer(void)
 {
         struct timeval tv;
         PY_LONG_LONG ret;
-#ifdef GETTIMEOFDAY_NO_TZ
-        gettimeofday(&tv);
-#else
         gettimeofday(&tv, (struct timezone *)NULL);
-#endif
         ret = tv.tv_sec;
         ret = ret * 1000000 + tv.tv_usec;
         return ret;