From 914b59533a094e815809f62441d02b560e23057b Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 6 Sep 2016 10:46:49 -0700 Subject: replace PY_LONG_LONG with long long --- Include/pytime.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Include/pytime.h') diff --git a/Include/pytime.h b/Include/pytime.h index 98612e1307..859321b34d 100644 --- a/Include/pytime.h +++ b/Include/pytime.h @@ -78,7 +78,7 @@ PyAPI_FUNC(_PyTime_t) _PyTime_FromSeconds(int seconds); ((_PyTime_t)(seconds) * (1000 * 1000 * 1000)) /* Create a timestamp from a number of nanoseconds. */ -PyAPI_FUNC(_PyTime_t) _PyTime_FromNanoseconds(PY_LONG_LONG ns); +PyAPI_FUNC(_PyTime_t) _PyTime_FromNanoseconds(long long ns); /* Convert a number of seconds (Python float or int) to a timetamp. Raise an exception and return -1 on error, return 0 on success. */ -- cgit v1.2.1 From d541e7ad34b152da0aa475e55a21edbc477091ff Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 6 Sep 2016 13:24:00 -0700 Subject: replace Python aliases for standard integer types with the standard integer types (#17884) --- Include/pytime.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'Include/pytime.h') diff --git a/Include/pytime.h b/Include/pytime.h index 859321b34d..595fafc5c0 100644 --- a/Include/pytime.h +++ b/Include/pytime.h @@ -13,16 +13,12 @@ functions and constants extern "C" { #endif -#ifdef PY_INT64_T /* _PyTime_t: Python timestamp with subsecond precision. It can be used to store a duration, and so indirectly a date (related to another date, like UNIX epoch). */ -typedef PY_INT64_T _PyTime_t; +typedef int64_t _PyTime_t; #define _PyTime_MIN PY_LLONG_MIN #define _PyTime_MAX PY_LLONG_MAX -#else -# error "_PyTime_t need signed 64-bit integer type" -#endif typedef enum { /* Round towards minus infinity (-inf). -- cgit v1.2.1 From ada5f796e97b5a38b43571134f846366876ae54d Mon Sep 17 00:00:00 2001 From: Alexander Belopolsky Date: Wed, 28 Sep 2016 17:31:35 -0400 Subject: Issue #28148: Stop using localtime() and gmtime() in the time module. Introduced platform independent _PyTime_localtime API that is similar to POSIX localtime_r, but available on all platforms. Patch by Ed Schouten. --- Include/pytime.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Include/pytime.h') diff --git a/Include/pytime.h b/Include/pytime.h index 595fafc5c0..87ac7fcbba 100644 --- a/Include/pytime.h +++ b/Include/pytime.h @@ -184,6 +184,14 @@ PyAPI_FUNC(int) _PyTime_GetMonotonicClockWithInfo( Return 0 on success, raise an exception and return -1 on error. */ PyAPI_FUNC(int) _PyTime_Init(void); +/* Converts a timestamp to the Gregorian time, using the local time zone. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_localtime(time_t t, struct tm *tm); + +/* Converts a timestamp to the Gregorian time, assuming UTC. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_gmtime(time_t t, struct tm *tm); + #ifdef __cplusplus } #endif -- cgit v1.2.1