Mesa (main): includes: add windows lean and mean guard.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 19 22:27:20 UTC 2022


Module: Mesa
Branch: main
Commit: 39bfb256271ad553ab2cad0700034cb359653def
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=39bfb256271ad553ab2cad0700034cb359653def

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Jan 19 17:42:04 2022 +1000

includes: add windows lean and mean guard.

When we drop gl.h some files pick up windows.h from here
without lean/mean and it causes conflicts.

Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14605>

---

 include/c11/threads_win32.h | 4 +++-
 src/util/memstream.h        | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/c11/threads_win32.h b/include/c11/threads_win32.h
index 8c014fab45c..1b740d58176 100644
--- a/include/c11/threads_win32.h
+++ b/include/c11/threads_win32.h
@@ -54,7 +54,9 @@ Configuration macro:
 #endif
 #define EMULATED_THREADS_TSS_DTOR_SLOTNUM 64  // see TLS_MINIMUM_AVAILABLE
 
-
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN 1
+#endif
 #include <windows.h>
 
 // check configuration
diff --git a/src/util/memstream.h b/src/util/memstream.h
index 2d4be8257c1..0bed1132559 100644
--- a/src/util/memstream.h
+++ b/src/util/memstream.h
@@ -31,6 +31,9 @@
 #include <stdbool.h>
 #include <stdio.h>
 #ifdef _WIN32
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN 1
+#endif
 #include <windows.h>
 #endif
 



More information about the mesa-commit mailing list