| 2802 | // gmtime_r can be defined by mingw |
| 2803 | #ifndef gmtime_r |
| 2804 | static struct tm *gmtime_r(const time_t *t, struct tm *r) |
| 2805 | { |
| 2806 | // gmtime is threadsafe in windows because it uses TLS |
| 2807 | const struct tm *theTm = gmtime(t); |
| 2808 | |
| 2809 | if (theTm) |
| 2810 | { |
| 2811 | *r = *theTm; |
| 2812 | return r; |
| 2813 | } |
| 2814 | else |
| 2815 | { |
| 2816 | return 0; |
| 2817 | } |
| 2818 | } |
| 2819 | #endif // gmtime_r |
| 2820 | #endif // _WIN32 |
| 2821 |