Mesa (master): vbo: avoid including wingdi.h on win32

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 16 15:09:18 UTC 2020


Module: Mesa
Branch: master
Commit: 0752648a993c6f0fae2f4a072079000b9d84d074
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0752648a993c6f0fae2f4a072079000b9d84d074

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Wed Apr 15 22:48:46 2020 +0200

vbo: avoid including wingdi.h on win32

On Windows, main/glheader.h ends up including windows.h which in turn
includes wingdi.h unless the NOGDI macro is defined. And wingdi.h
defines a macro called "ERROR", which we end up redefining below.

To avoid a warning on the redefinition, we can define NOGDI to prevent
wingdi.h from implicitly being included.

Reviewed-by: Brian Paul <brianp at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4577>

---

 src/mesa/vbo/vbo_noop.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/vbo/vbo_noop.c b/src/mesa/vbo/vbo_noop.c
index ab85904a442..e74b6500f5b 100644
--- a/src/mesa/vbo/vbo_noop.c
+++ b/src/mesa/vbo/vbo_noop.c
@@ -28,6 +28,9 @@
  * GLvertexformat no-op functions.  Used in out-of-memory situations.
  */
 
+#ifdef _WIN32
+#define NOGDI
+#endif
 
 #include "main/glheader.h"
 #include "main/context.h"



More information about the mesa-commit mailing list