src: Rename timegm as nghttp2_timegm

This commit is contained in:
Tatsuhiro Tsujikawa 2015-07-15 23:44:24 +09:00
parent ba31b990a2
commit 7a3012cc1b
3 changed files with 5 additions and 5 deletions

View File

@ -34,7 +34,7 @@ static int count_leap_year(int y) {
}
/* Based on the algorithm of Python 2.7 calendar.timegm. */
time_t timegm(struct tm *tm) {
time_t nghttp2_timegm(struct tm *tm) {
int days;
int num_leap_year;
int64_t t;

View File

@ -37,7 +37,7 @@ extern "C" {
#include <time.h>
#endif // HAVE_TIME_H
time_t timegm(struct tm *tm);
time_t nghttp2_timegm(struct tm *tm);
#ifdef __cplusplus
}

View File

@ -278,7 +278,7 @@ std::string common_log_date(time_t t) {
#ifdef HAVE_STRUCT_TM_TM_GMTOFF
auto gmtoff = tms.tm_gmtoff;
#else // !HAVE_STRUCT_TM_TM_GMTOFF
auto gmtoff = timegm(&tms) - t;
auto gmtoff = nghttp2_timegm(&tms) - t;
#endif // !HAVE_STRUCT_TM_TM_GMTOFF
if (gmtoff >= 0) {
*p++ = '+';
@ -326,7 +326,7 @@ std::string iso8601_date(int64_t ms) {
#ifdef HAVE_STRUCT_TM_TM_GMTOFF
auto gmtoff = tms.tm_gmtoff;
#else // !HAVE_STRUCT_TM_TM_GMTOFF
auto gmtoff = timegm(&tms) - sec;
auto gmtoff = nghttp2_timegm(&tms) - sec;
#endif // !HAVE_STRUCT_TM_TM_GMTOFF
if (gmtoff == 0) {
*p++ = 'Z';
@ -354,7 +354,7 @@ time_t parse_http_date(const std::string &s) {
if (r == 0) {
return 0;
}
return timegm(&tm);
return nghttp2_timegm(&tm);
}
namespace {