24#pragma GCC diagnostic push
26#pragma clang diagnostic ignored "-Wreserved-id-macro"
29#define _SEC_IN_MINUTE 60L
30#define _SEC_IN_HOUR 3600L
31#define _SEC_IN_DAY 86400L
33#pragma GCC diagnostic push
35#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
38 = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
39#pragma GCC diagnostic pop
41#define _DAYS_IN_MONTH(x) ((x == 1) ? days_in_feb : DAYS_IN_MONTH[x])
43#pragma GCC diagnostic push
45#pragma clang diagnostic ignored "-Wreserved-identifier"
46#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
49 = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
50#pragma GCC diagnostic pop
53 (((y) % 4) == 0 && (((y) % 100) != 0 || (((y) + 1900) % 400) == 0))
54#define _DAYS_IN_YEAR(year) (_ISLEAP (year) ? 366 : 365)
56#pragma GCC diagnostic pop
81 days += tim_p->tm_mday - 1;
82#pragma GCC diagnostic push
84#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
87#pragma GCC diagnostic pop
88 if (tim_p->tm_mon > 1 &&
_DAYS_IN_YEAR (tim_p->tm_year) == 366)
92 tim_p->tm_yday = (int)days;
94 if (tim_p->tm_year > 10000 || tim_p->tm_year < -10000)
98 if ((year = tim_p->tm_year) > 70)
100 for (year = 70; year < tim_p->tm_year; year++)
105 for (year = 69; year > tim_p->tm_year; year--)
114 if ((tim_p->tm_wday = (
int)((days + 4) % 7)) < 0)
128 int days_in_feb = 28;
130#pragma GCC diagnostic push
131#if defined(__clang__)
132#elif defined(__GNUC__)
134#pragma GCC diagnostic ignored "-Waggregate-return"
137 if (tim_p->tm_sec < 0 || tim_p->tm_sec > 59)
139 res = div (tim_p->tm_sec, 60);
140 tim_p->tm_min += res.quot;
141 if ((tim_p->tm_sec = res.rem) < 0)
148 if (tim_p->tm_min < 0 || tim_p->tm_min > 59)
150 res = div (tim_p->tm_min, 60);
151 tim_p->tm_hour += res.quot;
152 if ((tim_p->tm_min = res.rem) < 0)
159 if (tim_p->tm_hour < 0 || tim_p->tm_hour > 23)
161 res = div (tim_p->tm_hour, 24);
162 tim_p->tm_mday += res.quot;
163 if ((tim_p->tm_hour = res.rem) < 0)
165 tim_p->tm_hour += 24;
170 if (tim_p->tm_mon < 0 || tim_p->tm_mon > 11)
172 res = div (tim_p->tm_mon, 12);
173 tim_p->tm_year += res.quot;
174 if ((tim_p->tm_mon = res.rem) < 0)
180#pragma GCC diagnostic pop
185#pragma GCC diagnostic push
186#if defined(__clang__)
187#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
189 if (tim_p->tm_mday <= 0)
191 while (tim_p->tm_mday <= 0)
193 if (--tim_p->tm_mon == -1)
208 if (++tim_p->tm_mon == 12)
217#pragma GCC diagnostic pop
static void validate_structure(struct tm *tim_p)
static const int DAYS_IN_MONTH[12]
#define _DAYS_IN_YEAR(year)
static const int _DAYS_BEFORE_MONTH[12]
#define _DAYS_IN_MONTH(x)
time_t timegm(struct tm *tim_p)