MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / GetLocalTm

Function GetLocalTm

Sources/Shared/Containers/DateTime.cpp:88–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86 }
87
88 static struct tm* GetLocalTm(const time_t* ticks, struct tm* temp) noexcept
89 {
90#if defined(DEATH_TARGET_WINDOWS)
91 return (localtime_s(temp, ticks) == 0 ? temp : nullptr);
92#else
93 // TODO: This function is not thread-safe on Unix - use localtime_r instead
94 const tm* const result = localtime(ticks);
95 if (result == nullptr) {
96 return nullptr;
97 }
98
99 std::memcpy(temp, result, sizeof(struct tm));
100 return temp;
101#endif
102 }
103
104 static bool IsDST(DateTime date, std::int32_t& bias) noexcept
105 {

Callers 3

IsDSTFunction · 0.85
GetTimeZoneFunction · 0.85
TryGetTmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected