From f711b4f01f9921a52acde6135ca8dfa992172828 Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Tue, 30 Jan 2024 20:18:15 -0800 Subject: [PATCH] Avoid non-constant-expression cannot be narrowed on Windows mingw. Fixes non-constant-expression cannot be narrowed from type 'DWORD' (aka 'unsigned long') to 'int' in initializer list [-Wc++11-narrowing] Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com> --- platform/windows/display_server_windows.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 657caa79393f..fa73740e0470 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -247,8 +247,13 @@ class FileDialogEventHandler : public IFileDialogEvents, public IFileDialogContr // IUnknown methods HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppv) { static const QITAB qit[] = { +#ifdef __MINGW32__ + { &__uuidof(IFileDialogEvents), static_cast(OFFSETOFCLASS(IFileDialogEvents, FileDialogEventHandler)) }, + { &__uuidof(IFileDialogControlEvents), static_cast(OFFSETOFCLASS(IFileDialogControlEvents, FileDialogEventHandler)) }, +#else QITABENT(FileDialogEventHandler, IFileDialogEvents), QITABENT(FileDialogEventHandler, IFileDialogControlEvents), +#endif { 0, 0 }, }; return QISearch(this, qit, riid, ppv);