mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-27 05:04:01 +08:00
fix linux compilation
This commit is contained in:
parent
00c10d5800
commit
e213a44c55
@ -419,9 +419,15 @@ std::string common_helpers::get_utc_time()
|
|||||||
std::time_t time = std::time({});
|
std::time_t time = std::time({});
|
||||||
std::tm utc_time{};
|
std::tm utc_time{};
|
||||||
|
|
||||||
bool is_ok{};
|
bool is_ok = false;
|
||||||
#if defined(__linux__) || defined(linux)
|
#if defined(__linux__) || defined(linux)
|
||||||
is_ok = !!gmtime_s(&time, &utc_time);
|
{
|
||||||
|
auto utc_ptr = std::gmtime(&time);
|
||||||
|
if (utc_ptr) {
|
||||||
|
utc_time = *utc_ptr;
|
||||||
|
is_ok = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
is_ok = !gmtime_s(&utc_time, &time);
|
is_ok = !gmtime_s(&utc_time, &time);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user