Use this instead of gmtime_r if you want to build for Windows. Windows doesn't have a 'gmtime_r', but it has the similar 'gmtime_s'. TODO(user): Probably belongs in //base:time_support.{cc|h}.
| 42 | // Windows doesn't have a 'gmtime_r', but it has the similar 'gmtime_s'. |
| 43 | // TODO(user): Probably belongs in //base:time_support.{cc|h}. |
| 44 | static struct tm* PortableSafeGmtime(const time_t* timep, struct tm* result) { |
| 45 | #ifdef OS_WINDOWS |
| 46 | return gmtime_s(result, timep) == 0 ? result : NULL; |
| 47 | #else |
| 48 | return gmtime_r(timep, result); |
| 49 | #endif // OS_WINDOWS |
| 50 | } |
| 51 | |
| 52 | char* strnstr(const char* haystack, const char* needle, |
| 53 | size_t haystack_len) { |