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

Author: Yonggang Luo <[email protected]>
Date:   Thu Nov  3 00:16:36 2022 +0800

glapi: #include "util/glheader.h" in glapi_priv.h and glapitable.h directly

So that we do not need define GLAPIENTRY repeatedly, always using the
GLAPIENTRY macro comes from GL/gl.h

Signed-off-by: Yonggang Luo <[email protected]>
Reviewed-by: Jesse Natalie <[email protected]>
Acked-by: Brian Paul [email protected]
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

---

 src/glx/apple/apple_glapi.c                 | 1 -
 src/glx/apple/apple_xgl_api_read.c          | 1 -
 src/glx/apple/apple_xgl_api_stereo.c        | 1 -
 src/glx/apple/apple_xgl_api_viewport.c      | 1 -
 src/mapi/glapi/gen/gl_gentable.py           | 2 --
 src/mapi/glapi/gen/gl_table.py              | 9 +--------
 src/mapi/glapi/glapi_dispatch.c             | 7 +------
 src/mapi/glapi/glapi_priv.h                 | 8 +-------
 src/mapi/glapi/tests/check_table.cpp        | 1 -
 src/mapi/shared-glapi/tests/check_table.cpp | 1 -
 10 files changed, 3 insertions(+), 29 deletions(-)

diff --git a/src/glx/apple/apple_glapi.c b/src/glx/apple/apple_glapi.c
index 068f81a3d23..075231d3f40 100644
--- a/src/glx/apple/apple_glapi.c
+++ b/src/glx/apple/apple_glapi.c
@@ -38,7 +38,6 @@
 
 #include <GL/gl.h>
 
-#include "util/glheader.h"
 #include "glapi.h"
 #include "glapitable.h"
 
diff --git a/src/glx/apple/apple_xgl_api_read.c 
b/src/glx/apple/apple_xgl_api_read.c
index 7a796f04b28..612f5f7b01f 100644
--- a/src/glx/apple/apple_xgl_api_read.c
+++ b/src/glx/apple/apple_xgl_api_read.c
@@ -37,7 +37,6 @@
 #include "glxclient.h"
 #include "apple_glx_context.h"
 #include "apple_xgl_api.h"
-#include "util/glheader.h"
 #include "glapitable.h"
 
 extern struct _glapi_table * __ogl_framework_api;
diff --git a/src/glx/apple/apple_xgl_api_stereo.c 
b/src/glx/apple/apple_xgl_api_stereo.c
index 3fa2b9c7656..11a17a86ad8 100644
--- a/src/glx/apple/apple_xgl_api_stereo.c
+++ b/src/glx/apple/apple_xgl_api_stereo.c
@@ -40,7 +40,6 @@
 #include "glxclient.h"
 #include "apple_glx_context.h"
 #include "apple_xgl_api.h"
-#include "util/glheader.h"
 #include "glapitable.h"
 
 extern struct _glapi_table * __ogl_framework_api;
diff --git a/src/glx/apple/apple_xgl_api_viewport.c 
b/src/glx/apple/apple_xgl_api_viewport.c
index f36d0fb257e..ccc896ef129 100644
--- a/src/glx/apple/apple_xgl_api_viewport.c
+++ b/src/glx/apple/apple_xgl_api_viewport.c
@@ -30,7 +30,6 @@
 #include "glxclient.h"
 #include "apple_glx_context.h"
 #include "apple_xgl_api.h"
-#include "util/glheader.h"
 #include "glapitable.h"
 
 extern struct _glapi_table * __ogl_framework_api;
diff --git a/src/mapi/glapi/gen/gl_gentable.py 
b/src/mapi/glapi/gen/gl_gentable.py
index f1b4c47ccf9..8cd470f148d 100644
--- a/src/mapi/glapi/gen/gl_gentable.py
+++ b/src/mapi/glapi/gen/gl_gentable.py
@@ -49,8 +49,6 @@ header = """/* GLXEXT is the define used in the xserver when 
the GLX extension i
 #include <stdio.h>
 #include <string.h>
 
-#include "util/glheader.h"
-
 #include "glapi.h"
 #include "glapitable.h"
 
diff --git a/src/mapi/glapi/gen/gl_table.py b/src/mapi/glapi/gen/gl_table.py
index ea119e4b05e..ae42a080cd8 100644
--- a/src/mapi/glapi/gen/gl_table.py
+++ b/src/mapi/glapi/gen/gl_table.py
@@ -49,14 +49,7 @@ class PrintGlTable(gl_XML.gl_print_base):
                 f.return_type, f.name, arg_string, f.offset))
 
     def printRealHeader(self):
-        print('#ifndef GLAPIENTRYP')
-        print('# ifndef GLAPIENTRY')
-        print('#  define GLAPIENTRY')
-        print('# endif')
-        print('')
-        print('# define GLAPIENTRYP GLAPIENTRY *')
-        print('#endif')
-        print('')
+        print('#include "util/glheader.h"')
         print('')
         print('#ifdef __cplusplus')
         print('extern "C" {')
diff --git a/src/mapi/glapi/glapi_dispatch.c b/src/mapi/glapi/glapi_dispatch.c
index b462c4af93e..0661c2609b7 100644
--- a/src/mapi/glapi/glapi_dispatch.c
+++ b/src/mapi/glapi/glapi_dispatch.c
@@ -74,11 +74,6 @@
 
 #endif /* logging */
 
-
-#ifndef GLAPIENTRY
-#define GLAPIENTRY
-#endif
-
 #ifdef GLX_INDIRECT_RENDERING
 /* those link to libglapi.a should provide the entry points */
 #define _GLAPI_SKIP_PROTO_ENTRY_POINTS
@@ -150,7 +145,7 @@ GL_API void GL_APIENTRY glBlendBarrier (void);
 GL_API void GL_APIENTRY glPrimitiveBoundingBox (GLfloat minX, GLfloat minY, 
GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat 
maxW);
 
 /* Enable frame pointer elimination on Windows, otherwise forgetting to add
- * APIENTRY to _mesa_* entrypoints will not cause crashes on debug builds, as
+ * GLAPIENTRY to _mesa_* entrypoints will not cause crashes on debug builds, as
  * the initial ESP value is saved in the EBP in the function prologue, then
  * restored on the epilogue, clobbering any corruption in the ESP pointer due
  * to mismatch in the callee calling convention.
diff --git a/src/mapi/glapi/glapi_priv.h b/src/mapi/glapi/glapi_priv.h
index 04d8fd0c2ce..ec2dc46572f 100644
--- a/src/mapi/glapi/glapi_priv.h
+++ b/src/mapi/glapi/glapi_priv.h
@@ -26,14 +26,8 @@
 #ifndef _GLAPI_PRIV_H
 #define _GLAPI_PRIV_H
 
-
-#define GL_GLEXT_PROTOTYPES
-#include "GL/gl.h"
-#include "GL/glext.h"
-
-typedef int GLclampx;
-
 #include "glapi/glapi.h"
+#include "util/glheader.h"
 
 
 #ifdef __cplusplus
diff --git a/src/mapi/glapi/tests/check_table.cpp 
b/src/mapi/glapi/tests/check_table.cpp
index 93dbb9d9d8a..596f43fc4b2 100644
--- a/src/mapi/glapi/tests/check_table.cpp
+++ b/src/mapi/glapi/tests/check_table.cpp
@@ -22,7 +22,6 @@
  */
 
 #include <gtest/gtest.h>
-#include "util/glheader.h"
 
 #include "glapi/glapi.h"
 #include "glapitable.h"
diff --git a/src/mapi/shared-glapi/tests/check_table.cpp 
b/src/mapi/shared-glapi/tests/check_table.cpp
index 6c208858f7c..fdc9f7543c7 100644
--- a/src/mapi/shared-glapi/tests/check_table.cpp
+++ b/src/mapi/shared-glapi/tests/check_table.cpp
@@ -22,7 +22,6 @@
  */
 
 #include <gtest/gtest.h>
-#include "util/glheader.h"
 
 #include "glapi/glapi.h"
 #include "glapitable.h"

Reply via email to