summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
authorJakub KulĂ­k <Kulikjak@gmail.com>2018-12-31 02:16:40 (GMT)
committerGregory P. Smith <greg@krypto.org>2018-12-31 02:16:40 (GMT)
commit6f9bc72c79c3262e5d0f2c0e96b016477399cfb1 (patch)
tree62f29dd25098345fd413aa32d66d6baa6f95a7a8 /Modules/timemodule.c
parent30e023256aa1b00d4c783553752fc6f2cc0b9b27 (diff)
downloadcpython-6f9bc72c79c3262e5d0f2c0e96b016477399cfb1.zip
cpython-6f9bc72c79c3262e5d0f2c0e96b016477399cfb1.tar.gz
cpython-6f9bc72c79c3262e5d0f2c0e96b016477399cfb1.tar.bz2
bpo-35550: Fix incorrect Solaris define guards (GH-11275)
Python source code uses on several places ifdef sun or defined(sun) without the underscores, which is not standard compliant and shouldn't be used. Defines should check for __sun instead. Reference: http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system#Solaris https://bugs.python.org/issue35550
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 43951d5..fa0f198 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -755,7 +755,7 @@ time_strftime(PyObject *self, PyObject *args)
return NULL;
}
-#if defined(_MSC_VER) || defined(sun) || defined(_AIX)
+#if defined(_MSC_VER) || (defined(__sun) && defined(__SVR4)) || defined(_AIX)
if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900) {
PyErr_SetString(PyExc_ValueError,
"strftime() requires year in [1; 9999]");
@@ -801,7 +801,7 @@ time_strftime(PyObject *self, PyObject *args)
return NULL;
}
}
-#elif (defined(_AIX) || defined(sun)) && defined(HAVE_WCSFTIME)
+#elif (defined(_AIX) || (defined(__sun) && defined(__SVR4))) && defined(HAVE_WCSFTIME)
for (outbuf = wcschr(fmt, '%');
outbuf != NULL;
outbuf = wcschr(outbuf+2, '%'))