GCC 12.2 portability issues
This commit is contained in:
@@ -81,8 +81,11 @@ namespace pipedal
|
|||||||
port.canReadSubscribe = capability & SND_SEQ_PORT_CAP_SUBS_READ;
|
port.canReadSubscribe = capability & SND_SEQ_PORT_CAP_SUBS_READ;
|
||||||
port.canWriteSubscribe = capability & SND_SEQ_PORT_CAP_SUBS_WRITE;
|
port.canWriteSubscribe = capability & SND_SEQ_PORT_CAP_SUBS_WRITE;
|
||||||
auto typeBits = snd_seq_port_info_get_type(port_info);
|
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;
|
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.isSystemAnnounce = (typeBits & SND_SEQ_PORT_SYSTEM_ANNOUNCE) != 0;
|
||||||
port.isMidiSynth = (typeBits & SND_SEQ_PORT_TYPE_MIDI_GENERIC) != 0 ||
|
port.isMidiSynth = (typeBits & SND_SEQ_PORT_TYPE_MIDI_GENERIC) != 0 ||
|
||||||
(typeBits & SND_SEQ_PORT_TYPE_MIDI_GM) != 0 ||
|
(typeBits & SND_SEQ_PORT_TYPE_MIDI_GM) != 0 ||
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ std::string HtmlHelper::timeToHttpDate(std::filesystem::file_time_type time)
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Convert to time_t.
|
// 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);
|
return timeToHttpDate(time_t_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,8 @@
|
|||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include <vector>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#define DECLARE_JSON_MAP(CLASSNAME) \
|
#define DECLARE_JSON_MAP(CLASSNAME) \
|
||||||
static pipedal::json_map::storage_type<CLASSNAME> jmap
|
static pipedal::json_map::storage_type<CLASSNAME> jmap
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include <memory>
|
||||||
#include "json.hpp"
|
#include "json.hpp"
|
||||||
|
|
||||||
namespace pipedal
|
namespace pipedal
|
||||||
|
|||||||
+4
-2
@@ -33,6 +33,7 @@
|
|||||||
#include "Lv2Log.hpp"
|
#include "Lv2Log.hpp"
|
||||||
#include "ss.hpp"
|
#include "ss.hpp"
|
||||||
#include "util.hpp"
|
#include "util.hpp"
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#undef _GLIBCXX_DEBUG // Ensure we are not in debug mode, as this file is not compatible with it.
|
#undef _GLIBCXX_DEBUG // Ensure we are not in debug mode, as this file is not compatible with it.
|
||||||
#include "SQLiteCpp/SQLiteCpp.h"
|
#include "SQLiteCpp/SQLiteCpp.h"
|
||||||
@@ -112,8 +113,9 @@ namespace
|
|||||||
|
|
||||||
static int64_t fileTimeToInt64(const fs::file_time_type &fileTime)
|
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 sctp = std::chrono::time_point_cast<std::chrono::system_clock::duration>(
|
||||||
auto result = std::chrono::duration_cast<std::chrono::milliseconds>(system_time.time_since_epoch()).count();
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
static int64_t GetLastWriteTime(const fs::path &file)
|
static int64_t GetLastWriteTime(const fs::path &file)
|
||||||
|
|||||||
Reference in New Issue
Block a user