diff --git a/Network/NetworkMessage.cpp b/Network/NetworkMessage.cpp index 5af133c7f..a1e7050f2 100644 --- a/Network/NetworkMessage.cpp +++ b/Network/NetworkMessage.cpp @@ -28,13 +28,13 @@ namespace NetworkMessage { setVersion (QDataStream::Qt_5_0); // Qt schema version } -#if QT_VERSION >= 0x050200 +#if QT_VERSION >= QT_VERSION_CHECK (5, 2, 0) else if (schema <= 2) { setVersion (QDataStream::Qt_5_2); // Qt schema version } #endif -#if QT_VERSION >= 0x050400 +#if QT_VERSION >= QT_VERSION_CHECK (5, 4, 0) else if (schema <= 3) { setVersion (QDataStream::Qt_5_4); // Qt schema version @@ -73,13 +73,13 @@ namespace NetworkMessage { parent->setVersion (QDataStream::Qt_5_0); } -#if QT_VERSION >= 0x050200 +#if QT_VERSION >= QT_VERSION_CHECK (5, 2, 0) else if (schema_ <= 2) { parent->setVersion (QDataStream::Qt_5_2); } #endif -#if QT_VERSION >= 0x050400 +#if QT_VERSION >= QT_VERSION_CHECK (5, 4, 0) else if (schema_ <= 3) { parent->setVersion (QDataStream::Qt_5_4); diff --git a/Network/NetworkMessage.hpp b/Network/NetworkMessage.hpp index c484efb23..f892eda06 100644 --- a/Network/NetworkMessage.hpp +++ b/Network/NetworkMessage.hpp @@ -540,9 +540,9 @@ namespace NetworkMessage // increment this if a newer Qt schema is required and add decode // logic to the Builder and Reader class implementations -#if QT_VERSION >= 0x050400 +#if QT_VERSION >= QT_VERSION_CHECK (5, 4, 0) static quint32 constexpr schema_number {3}; -#elif QT_VERSION >= 0x050200 +#elif QT_VERSION >= QT_VERSION_CHECK (5, 2, 0) static quint32 constexpr schema_number {2}; #else // Schema 1 (Qt_5_0) is broken diff --git a/UDPExamples/UDPDaemon.cpp b/UDPExamples/UDPDaemon.cpp index 6d98b3a6b..78d1a0c52 100644 --- a/UDPExamples/UDPDaemon.cpp +++ b/UDPExamples/UDPDaemon.cpp @@ -169,7 +169,7 @@ public: connect (server_, &MessageServer::client_opened, this, &Server::add_client); connect (server_, &MessageServer::client_closed, this, &Server::remove_client); -#if QT_VERSION >= 0x051400 +#if QT_VERSION >= QT_VERSION_CHECK (5, 14, 0) server_->start (port, multicast_group, QSet {network_interface_names.begin (), network_interface_names.end ()}); #else server_->start (port, multicast_group, network_interface_names.toSet ()); diff --git a/qt_helpers.hpp b/qt_helpers.hpp index 034a8852f..416b6421b 100644 --- a/qt_helpers.hpp +++ b/qt_helpers.hpp @@ -120,7 +120,7 @@ namespace std inline bool is_broadcast_address (QHostAddress const& host_addr) { -#if QT_VERSION >= 0x051100 +#if QT_VERSION >= QT_VERSION_CHECK (5, 11, 0) return host_addr.isBroadcast (); #else bool ok; @@ -131,7 +131,7 @@ bool is_broadcast_address (QHostAddress const& host_addr) inline bool is_multicast_address (QHostAddress const& host_addr) { -#if QT_VERSION >= 0x050600 +#if QT_VERSION >= QT_VERSION_CHECK (5, 6, 0) return host_addr.isMulticast (); #else bool ok;