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

Author: Yonggang Luo <[email protected]>
Date:   Thu Dec 14 03:17:34 2023 +0800

osmesa: Fixes building osmesa.c on windows

Fixes: 5bf68ab7013 ("osmesa: Make osmesa.h compatible with Windows SDK's GL.h")

Signed-off-by: Yonggang Luo <[email protected]>
Ack-by: Jesse Natalie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26674>

---

 src/gallium/frontends/osmesa/osmesa.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/gallium/frontends/osmesa/osmesa.c 
b/src/gallium/frontends/osmesa/osmesa.c
index 9962f7fb2cf..5bf4c5baab9 100644
--- a/src/gallium/frontends/osmesa/osmesa.c
+++ b/src/gallium/frontends/osmesa/osmesa.c
@@ -48,14 +48,21 @@
  * much nicer, new off-screen Gallium interface...
  */
 
+/**
+ * The following block is for avoid windows.h to be included
+ * and osmesa require APIENTRY to be defined
+ */
+#include "util/glheader.h"
+#ifndef APIENTRY
+#define APIENTRY GLAPIENTRY
+#endif
+#include "GL/osmesa.h"
 
 #include <stdio.h>
 #include <c11/threads.h>
 
 #include "state_tracker/st_context.h"
 
-#include "GL/osmesa.h"
-
 #include "glapi/glapi.h"  /* for OSMesaGetProcAddress below */
 
 #include "pipe/p_context.h"

Reply via email to