summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-04-20 11:41:09 (GMT)
committerGitHub <noreply@github.com>2017-04-20 11:41:09 (GMT)
commit8f5cdfa9fc1bb6b4d9a33fc281987252f6398430 (patch)
tree0c9528b6415599d97fa32956fa8997271bde54b8 /Modules
parentd20324a7fab6734bae19b1f070b5c8aae5ff3612 (diff)
downloadcpython-8f5cdfa9fc1bb6b4d9a33fc281987252f6398430.zip
cpython-8f5cdfa9fc1bb6b4d9a33fc281987252f6398430.tar.gz
cpython-8f5cdfa9fc1bb6b4d9a33fc281987252f6398430.tar.bz2
Only define get_zone() and get_gmtoff() if needed (#1193)
Only define the get_zone() and get_gmtoff() private functions in the time module if these functions are needed to initialize the module. The change fixes the following warnings on AIX: Modules/timemodule.c:1175:1: warning: 'get_gmtoff' defined but not used [-Wunused-function] Modules/timemodule.c:1164:1: warning: 'get_zone' defined but not used [-Wunused-function]
Diffstat (limited to 'Modules')
-rw-r--r--Modules/timemodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 25eb92d..423c001 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -1160,6 +1160,7 @@ PyDoc_STRVAR(get_clock_info_doc,
\n\
Get information of the specified clock.");
+#if !defined(HAVE_TZNAME) || defined(__GLIBC__) || defined(__CYGWIN__)
static void
get_zone(char *zone, int n, struct tm *p)
{
@@ -1180,6 +1181,7 @@ get_gmtoff(time_t t, struct tm *p)
return timegm(p) - t;
#endif
}
+#endif /* !defined(HAVE_TZNAME) || defined(__GLIBC__) || defined(__CYGWIN__) */
static void
PyInit_timezone(PyObject *m) {