cpython: 8a504694d92f (original) (raw)

--- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -15,6 +15,12 @@ static struct tm *localtime_r(const time return result; return NULL; } +static struct tm *gmtime_r(const time_t *timep, struct tm *result) +{

+} #endif /* Differentiate between building the core module and building extension @@ -2517,14 +2523,13 @@ date_new(PyTypeObject *type, PyObject *a static PyObject * date_local_from_object(PyObject *cls, PyObject *obj) {

#ifdef EINVAL if (errno == 0) @@ -2535,9 +2540,9 @@ date_local_from_object(PyObject *cls, Py } return PyObject_CallFunction(cls, "iii",

} /* Return new date from current time. @@ -4194,8 +4199,8 @@ datetime_new(PyTypeObject type, PyObjec return self; } -/ TM_FUNC is the shared type of localtime() and gmtime(). */ -typedef struct tm *(*TM_FUNC)(const time_t timer); +/ TM_FUNC is the shared type of localtime_r() and gmtime_r(). */ +typedef struct tm *(TM_FUNC)(const time_t timer, struct tm); / As of version 2015f max fold in IANA database is

{

#ifdef EINVAL if (errno == 0) errno = EINVAL; @@ -4256,20 +4260,20 @@ datetime_from_timet_and_us(PyObject *cls return PyErr_SetFromErrno(PyExc_OSError); }

-

+

result_seconds = utc_to_seconds(year, month, day, @@ -4357,7 +4361,7 @@ datetime_datetime_now_impl(PyTypeObject return NULL; self = datetime_best_possible((PyObject *)type,

@@ -4372,7 +4376,7 @@ datetime_datetime_now_impl(PyTypeObject static PyObject * datetime_utcnow(PyObject *cls, PyObject *dummy) {

} /* Return new local datetime from timestamp (Python timestamp -- a double). */ @@ -4391,7 +4395,7 @@ datetime_fromtimestamp(PyObject *cls, Py return NULL; self = datetime_from_timestamp(cls,

+#ifdef EINVAL

+#endif

#ifdef HAVE_STRUCT_TM_TM_ZONE

#else /* HAVE_STRUCT_TM_TM_ZONE */ { PyObject *local_time, *utc_time;

+#ifdef EINVAL

+#endif