| 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 | { |
no outgoing calls
no test coverage detected