diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-06-22 10:05:23 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-06-26 18:10:42 +0000 |
commit | a8a0dffd1f78d27c04cfd1e20563e9ddda4a135c (patch) | |
tree | ba4aebe6554efafce1c6b3186b33510e3b57e91f /src/plugins/platforms/windows/qwindowsglcontext.h | |
parent | 6f53c2bc967641ef16d681e7cec0db200e4da244 (diff) |
Windows QPA/GL: Fix build with MinGW/g++ 8.1 x64
Fix warnings about invalid function type casts (return types
conflicting with the PROC returned by wglGetProcAddress()) like:
qwindowsglcontext.cpp:1250:138: error: cast between incompatible function types from 'PROC' {aka 'long long int (*)()'} to 'GLenum (*)()' {aka 'unsigned int (*)()'} [-Werror=cast-function-type]
m_getGraphicsResetStatus = (GLenum (APIENTRY *)()) QOpenGLStaticContext::opengl32.wglGetProcAddress("glGetGraphicsResetStatusARB");
by introducing nested casts.
Task-number: QTBUG-68742
Task-number: QTQAINFRA-2095
Change-Id: I7c51836f2b9f7e2a6fa17c5108d59b23c42fb99d
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsglcontext.h')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsglcontext.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.h b/src/plugins/platforms/windows/qwindowsglcontext.h index 2d5b94af0e..87c3723c26 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.h +++ b/src/plugins/platforms/windows/qwindowsglcontext.h @@ -122,7 +122,7 @@ struct QWindowsOpengl32DLL void (APIENTRY * glGetIntegerv)(GLenum pname, GLint* params); const GLubyte * (APIENTRY * glGetString)(GLenum name); - FARPROC resolve(const char *name); + QFunctionPointer resolve(const char *name); private: HMODULE m_lib; bool m_nonOpengl32; @@ -217,6 +217,8 @@ public: void *nativeContext() const override { return m_renderingContext; } private: + typedef GLenum (APIENTRY *GlGetGraphicsResetStatusArbType)(); + inline void releaseDCs(); bool updateObtainedParams(HDC hdc, int *obtainedSwapInterval = 0); @@ -230,7 +232,7 @@ private: bool m_extensionsUsed; int m_swapInterval; bool m_ownsContext; - GLenum (APIENTRY * m_getGraphicsResetStatus)(); + GlGetGraphicsResetStatusArbType m_getGraphicsResetStatus; bool m_lost; }; #endif |