mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 13:10:05 +00:00
Fixes for gcc13
This commit is contained in:
parent
d8eb96b624
commit
aa0bcd432e
4 changed files with 12 additions and 6 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
namespace scwx
|
||||
|
|
@ -7,7 +8,7 @@ namespace scwx
|
|||
namespace common
|
||||
{
|
||||
|
||||
std::string GetVcpDescription(uint16_t vcp);
|
||||
std::string GetVcpDescription(std::uint16_t vcp);
|
||||
|
||||
} // namespace common
|
||||
} // namespace scwx
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <istream>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
|
|
|||
|
|
@ -62,10 +62,13 @@ std::string TimeString(std::chrono::system_clock::time_point time,
|
|||
#if defined(_MSC_VER)
|
||||
# define FORMAT_STRING_24_HOUR "{:%Y-%m-%d %H:%M:%S %Z}"
|
||||
# define FORMAT_STRING_12_HOUR "{:%Y-%m-%d %I:%M:%S %p %Z}"
|
||||
namespace date = std::chrono;
|
||||
namespace df = std;
|
||||
#else
|
||||
# define FORMAT_STRING_24_HOUR "%Y-%m-%d %H:%M:%S %Z"
|
||||
# define FORMAT_STRING_12_HOUR "%Y-%m-%d %I:%M:%S %p %Z"
|
||||
using namespace date;
|
||||
namespace df = date;
|
||||
#endif
|
||||
|
||||
auto timeInSeconds = time_point_cast<seconds>(time);
|
||||
|
|
@ -77,15 +80,15 @@ std::string TimeString(std::chrono::system_clock::time_point time,
|
|||
{
|
||||
try
|
||||
{
|
||||
zoned_time zt = {timeZone, timeInSeconds};
|
||||
date::zoned_time zt = {timeZone, timeInSeconds};
|
||||
|
||||
if (clockFormat == ClockFormat::_24Hour)
|
||||
{
|
||||
os << format(FORMAT_STRING_24_HOUR, zt);
|
||||
os << df::format(FORMAT_STRING_24_HOUR, zt);
|
||||
}
|
||||
else
|
||||
{
|
||||
os << format(FORMAT_STRING_12_HOUR, zt);
|
||||
os << df::format(FORMAT_STRING_12_HOUR, zt);
|
||||
}
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
|
|
@ -107,11 +110,11 @@ std::string TimeString(std::chrono::system_clock::time_point time,
|
|||
{
|
||||
if (clockFormat == ClockFormat::_24Hour)
|
||||
{
|
||||
os << format(FORMAT_STRING_24_HOUR, timeInSeconds);
|
||||
os << df::format(FORMAT_STRING_24_HOUR, timeInSeconds);
|
||||
}
|
||||
else
|
||||
{
|
||||
os << format(FORMAT_STRING_12_HOUR, timeInSeconds);
|
||||
os << df::format(FORMAT_STRING_12_HOUR, timeInSeconds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue