GCC 12.2 portability issues

This commit is contained in:
Robin E. R. Davies
2025-06-27 06:09:41 -04:00
parent 96af9287ba
commit f0628c2cce
6 changed files with 15 additions and 5 deletions
+4 -1
View File
@@ -81,8 +81,11 @@ namespace pipedal
port.canReadSubscribe = capability & SND_SEQ_PORT_CAP_SUBS_READ;
port.canWriteSubscribe = capability & SND_SEQ_PORT_CAP_SUBS_WRITE;
auto typeBits = snd_seq_port_info_get_type(port_info);
#ifdef SND_SEQ_PORT_TYPE_MIDI_UMP
port.isUmp = (typeBits & SND_SEQ_PORT_TYPE_MIDI_UMP) != 0;
#else
port.isUmp = false; // UMP support is not available in all versions of ALSA
#endif
port.isSystemAnnounce = (typeBits & SND_SEQ_PORT_SYSTEM_ANNOUNCE) != 0;
port.isMidiSynth = (typeBits & SND_SEQ_PORT_TYPE_MIDI_GENERIC) != 0 ||
(typeBits & SND_SEQ_PORT_TYPE_MIDI_GM) != 0 ||
+2 -2
View File
@@ -44,9 +44,9 @@ std::string HtmlHelper::timeToHttpDate(std::filesystem::file_time_type time)
{
// Convert to time_t.
std::chrono::system_clock::time_point system_time = std::chrono::clock_cast<std::chrono::system_clock>(time);
auto sctp = std::chrono::time_point_cast<std::chrono::system_clock::duration>(time - std::filesystem::file_time_type::clock::now() + std::chrono::system_clock::now());
auto time_t_value = std::chrono::system_clock::to_time_t(system_time);
auto time_t_value = std::chrono::system_clock::to_time_t(sctp);
return timeToHttpDate(time_t_value);
}
+2
View File
@@ -35,6 +35,8 @@
#include <string_view>
#include <string.h>
#include <stdexcept>
#include <vector>
#include <memory>
#define DECLARE_JSON_MAP(CLASSNAME) \
static pipedal::json_map::storage_type<CLASSNAME> jmap
@@ -30,6 +30,7 @@
#include <string>
#include <stdexcept>
#include <utility>
#include <memory>
#include "json.hpp"
namespace pipedal
+4 -2
View File
@@ -33,6 +33,7 @@
#include "Lv2Log.hpp"
#include "ss.hpp"
#include "util.hpp"
#include <algorithm>
#undef _GLIBCXX_DEBUG // Ensure we are not in debug mode, as this file is not compatible with it.
#include "SQLiteCpp/SQLiteCpp.h"
@@ -112,8 +113,9 @@ namespace
static int64_t fileTimeToInt64(const fs::file_time_type &fileTime)
{
std::chrono::system_clock::time_point system_time = std::chrono::clock_cast<std::chrono::system_clock>(fileTime);
auto result = std::chrono::duration_cast<std::chrono::milliseconds>(system_time.time_since_epoch()).count();
auto sctp = std::chrono::time_point_cast<std::chrono::system_clock::duration>(
fileTime - fs::file_time_type::clock::now() + std::chrono::system_clock::now());
auto result = std::chrono::duration_cast<std::chrono::milliseconds>(sctp.time_since_epoch()).count();
return result;
}
static int64_t GetLastWriteTime(const fs::path &file)
+2
View File
@@ -1,3 +1,5 @@
check filetime conversion in gcc 12.2.
AudioFiles.cpp fileTimeToInt64