Fixes for gcc13

This commit is contained in:
Dan Paulat 2024-07-04 12:52:09 -05:00
parent d8eb96b624
commit aa0bcd432e
4 changed files with 12 additions and 6 deletions

View file

@ -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

View file

@ -1,5 +1,6 @@
#pragma once #pragma once
#include <cstdint>
#include <istream> #include <istream>
#include <vector> #include <vector>

View file

@ -1,5 +1,6 @@
#pragma once #pragma once
#include <cstdint>
#include <optional> #include <optional>
#include <string> #include <string>
#include <vector> #include <vector>

View file

@ -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);
} }
} }
} }