浏览代码

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 <[email protected]>
K. S. Ernest (iFire) Lee 1 年之前
父节点
当前提交
f711b4f01f
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      platform/windows/display_server_windows.cpp

+ 5 - 0
platform/windows/display_server_windows.cpp

@@ -247,8 +247,13 @@ public:
 	// IUnknown methods
 	HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppv) {
 		static const QITAB qit[] = {
+#ifdef __MINGW32__
+			{ &__uuidof(IFileDialogEvents), static_cast<decltype(qit[0].dwOffset)>(OFFSETOFCLASS(IFileDialogEvents, FileDialogEventHandler)) },
+			{ &__uuidof(IFileDialogControlEvents), static_cast<decltype(qit[0].dwOffset)>(OFFSETOFCLASS(IFileDialogControlEvents, FileDialogEventHandler)) },
+#else
 			QITABENT(FileDialogEventHandler, IFileDialogEvents),
 			QITABENT(FileDialogEventHandler, IFileDialogControlEvents),
+#endif
 			{ 0, 0 },
 		};
 		return QISearch(this, qit, riid, ppv);