MCPcopy Create free account
hub / github.com/apache/impala / PortableSafeGmtime

Function PortableSafeGmtime

be/src/gutil/strings/util.cc:44–50  ·  view source on GitHub ↗

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}.

Source from the content-addressed store, hash-verified

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}.
44static 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
52char* strnstr(const char* haystack, const char* needle,
53 size_t haystack_len) {

Callers 1

FastTimeToBufferFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected