mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 18:30:06 +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
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace scwx
|
namespace scwx
|
||||||
|
|
@ -7,7 +8,7 @@ namespace scwx
|
||||||
namespace common
|
namespace common
|
||||||
{
|
{
|
||||||
|
|
||||||
std::string GetVcpDescription(uint16_t vcp);
|
std::string GetVcpDescription(std::uint16_t vcp);
|
||||||
|
|
||||||
} // namespace common
|
} // namespace common
|
||||||
} // namespace scwx
|
} // namespace scwx
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
#include <istream>
|
#include <istream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
|
||||||
|
|
@ -62,10 +62,13 @@ std::string TimeString(std::chrono::system_clock::time_point time,
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
# define FORMAT_STRING_24_HOUR "{:%Y-%m-%d %H:%M:%S %Z}"
|
# 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}"
|
# define FORMAT_STRING_12_HOUR "{:%Y-%m-%d %I:%M:%S %p %Z}"
|
||||||
|
namespace date = std::chrono;
|
||||||
|
namespace df = std;
|
||||||
#else
|
#else
|
||||||
# define FORMAT_STRING_24_HOUR "%Y-%m-%d %H:%M:%S %Z"
|
# 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"
|
# define FORMAT_STRING_12_HOUR "%Y-%m-%d %I:%M:%S %p %Z"
|
||||||
using namespace date;
|
using namespace date;
|
||||||
|
namespace df = date;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto timeInSeconds = time_point_cast<seconds>(time);
|
auto timeInSeconds = time_point_cast<seconds>(time);
|
||||||
|
|
@ -77,15 +80,15 @@ std::string TimeString(std::chrono::system_clock::time_point time,
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
zoned_time zt = {timeZone, timeInSeconds};
|
date::zoned_time zt = {timeZone, timeInSeconds};
|
||||||
|
|
||||||
if (clockFormat == ClockFormat::_24Hour)
|
if (clockFormat == ClockFormat::_24Hour)
|
||||||
{
|
{
|
||||||
os << format(FORMAT_STRING_24_HOUR, zt);
|
os << df::format(FORMAT_STRING_24_HOUR, zt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
os << format(FORMAT_STRING_12_HOUR, zt);
|
os << df::format(FORMAT_STRING_12_HOUR, zt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const std::exception& ex)
|
catch (const std::exception& ex)
|
||||||
|
|
@ -107,11 +110,11 @@ std::string TimeString(std::chrono::system_clock::time_point time,
|
||||||
{
|
{
|
||||||
if (clockFormat == ClockFormat::_24Hour)
|
if (clockFormat == ClockFormat::_24Hour)
|
||||||
{
|
{
|
||||||
os << format(FORMAT_STRING_24_HOUR, timeInSeconds);
|
os << df::format(FORMAT_STRING_24_HOUR, timeInSeconds);
|
||||||
}
|
}
|
||||||
else
|
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