vbo: avoid including wingdi.h on win32
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 15 Apr 2020 20:48:46 +0000 (22:48 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 16 Apr 2020 14:48:40 +0000 (14:48 +0000)
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@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4577>

src/mesa/vbo/vbo_noop.c

index ab85904a4429b79bea314dcaff87be4f6828287c..e74b6500f5b4b116dda81ced5a62e27b5f2a794b 100644 (file)
@@ -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"