From 53caee8ceb4dd63ae4e5701862aea4a9559312ad Mon Sep 17 00:00:00 2001 From: gxalpha Date: Fri, 25 Nov 2022 10:32:28 +0100 Subject: [PATCH] UI: Guard GetMonitorName behind Qt < 6.4 d27cda1 made this unnecessary on other Qt versions --- UI/platform-windows.cpp | 2 ++ UI/platform.hpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/UI/platform-windows.cpp b/UI/platform-windows.cpp index d06447b5d..3834ed404 100644 --- a/UI/platform-windows.cpp +++ b/UI/platform-windows.cpp @@ -356,6 +356,7 @@ static BOOL CALLBACK GetMonitorCallback(HMONITOR monitor, HDC, LPRECT, return true; } +#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0) #define GENERIC_MONITOR_NAME QStringLiteral("Generic PnP Monitor") QString GetMonitorName(const QString &id) @@ -417,6 +418,7 @@ QString GetMonitorName(const QString &id) return QString::fromWCharArray(target.monitorFriendlyDeviceName); } +#endif /* Based on https://www.winehq.org/pipermail/wine-devel/2008-September/069387.html */ typedef const char *(CDECL *WINEGETVERSION)(void); diff --git a/UI/platform.hpp b/UI/platform.hpp index c9c0c4ede..746e57848 100644 --- a/UI/platform.hpp +++ b/UI/platform.hpp @@ -74,7 +74,9 @@ public: RunOnceMutex &operator=(RunOnceMutex &&rom); }; +#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0) QString GetMonitorName(const QString &id); +#endif bool IsRunningOnWine(); #endif