From 244c9cc45efb2844b083999b9aa8db7615ca1f81 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 18 Feb 2025 12:04:18 -0500 Subject: [PATCH] mapi/glx: Remove FASTCALL/PURE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This isn't worth the complexity. Reviewed-by: Alyssa Rosenzweig Reviewed-by: Eric Engestrom Reviewed-by: Marek Olšák Acked-By: Mike Blumenkrantz Part-of: --- src/mapi/glapi/gen/glX_proto_send.py | 12 ++++----- src/mapi/glapi/gen/glX_proto_size.py | 16 +++--------- src/mapi/glapi/gen/gl_XML.py | 39 ---------------------------- 3 files changed, 9 insertions(+), 58 deletions(-) diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py index 800753abf31..a018749b4ec 100644 --- a/src/mapi/glapi/gen/glX_proto_send.py +++ b/src/mapi/glapi/gen/glX_proto_send.py @@ -176,7 +176,6 @@ class PrintGlxProtoStubs(glX_proto_common.glx_print_proto): print('#include ') print('') - self.printFastcall() self.printNoinline() print('') @@ -283,7 +282,7 @@ __glXReadPixelReply( Display *dpy, struct glx_context * gc, unsigned max_dim, #define X_GLXSingle 0 -NOINLINE FASTCALL GLubyte * +NOINLINE GLubyte * __glXSetupSingleRequest( struct glx_context * gc, GLint sop, GLint cmdlen ) { xGLXSingleReq * req; @@ -298,7 +297,7 @@ __glXSetupSingleRequest( struct glx_context * gc, GLint sop, GLint cmdlen ) return (GLubyte *)(req) + sz_xGLXSingleReq; } -NOINLINE FASTCALL GLubyte * +NOINLINE GLubyte * __glXSetupVendorRequest( struct glx_context * gc, GLint code, GLint vop, GLint cmdlen ) { xGLXVendorPrivateReq * req; @@ -425,7 +424,7 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; def print_generic_function(self, n): size = (n + 3) & ~3 - print("""static FASTCALL NOINLINE void + print("""static NOINLINE void generic_%u_byte( GLint rop, const void * ptr ) { struct glx_context * const gc = __glXGetCurrentContext(); @@ -1011,7 +1010,6 @@ class PrintGlxProtoInit_h(gl_XML.gl_print_base): * \\author Ian Romanick */ """) - self.printFastcall() self.printNoinline() print(""" @@ -1026,10 +1024,10 @@ extern NOINLINE void __glXReadPixelReply( Display *dpy, GLint depth, GLenum format, GLenum type, void * dest, GLboolean dimensions_in_reply ); -extern NOINLINE FASTCALL GLubyte * __glXSetupSingleRequest( +extern NOINLINE GLubyte * __glXSetupSingleRequest( struct glx_context * gc, GLint sop, GLint cmdlen ); -extern NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest( +extern NOINLINE GLubyte * __glXSetupVendorRequest( struct glx_context * gc, GLint code, GLint vop, GLint cmdlen ); """) diff --git a/src/mapi/glapi/gen/glX_proto_size.py b/src/mapi/glapi/gen/glX_proto_size.py index b5362614ef4..5d94d856c44 100644 --- a/src/mapi/glapi/gen/glX_proto_size.py +++ b/src/mapi/glapi/gen/glX_proto_size.py @@ -225,7 +225,7 @@ class glx_enum_function(object): def Print(self, name): - print('PURE FASTCALL GLint') + print('GLint') print('__gl%s_size( GLenum e )' % (name)) print('{') @@ -263,20 +263,16 @@ class PrintGlxSizeStubs_c(PrintGlxSizeStubs_common): print('#include "indirect_size.h"') - print('') - self.printPure() - print('') - self.printFastcall() print('') print('') print('#ifdef HAVE_FUNC_ATTRIBUTE_ALIAS') print('# define ALIAS2(from,to) \\') - print(' PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\') + print(' GLint __gl ## from ## _size( GLenum e ) \\') print(' __attribute__ ((alias( # to )));') print('# define ALIAS(from,to) ALIAS2( from, __gl ## to ## _size )') print('#else') print('# define ALIAS(from,to) \\') - print(' PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\') + print(' GLint __gl ## from ## _size( GLenum e ) \\') print(' { return __gl ## to ## _size( e ); }') print('#endif') print('') @@ -318,10 +314,6 @@ class PrintGlxSizeStubs_h(PrintGlxSizeStubs_common): """) print('#include ') print('') - self.printPure(); - print('') - self.printFastcall(); - print('') def printBody(self, api): @@ -331,7 +323,7 @@ class PrintGlxSizeStubs_h(PrintGlxSizeStubs_common): continue if (ef.is_set() and self.emit_set) or (not ef.is_set() and self.emit_get): - print('extern PURE FASTCALL GLint __gl%s_size(GLenum);' % (func.name)) + print('extern GLint __gl%s_size(GLenum);' % (func.name)) class PrintGlxReqSize_common(gl_XML.gl_print_base): diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py index 6bb22e5a661..17b9d660266 100644 --- a/src/mapi/glapi/gen/gl_XML.py +++ b/src/mapi/glapi/gen/gl_XML.py @@ -161,45 +161,6 @@ class gl_print_base(object): return - def printPure(self): - """Conditionally define `PURE' function attribute. - - Conditionally defines a preprocessor macro `PURE' that wraps - GCC's `pure' function attribute. The conditional code can be - easilly adapted to other compilers that support a similar - feature. - - The name is also added to the file's undef_list. - """ - self.undef_list.append("PURE") - print("""# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) -# define PURE __attribute__((pure)) -# else -# define PURE -# endif""") - return - - - def printFastcall(self): - """Conditionally define `FASTCALL' function attribute. - - Conditionally defines a preprocessor macro `FASTCALL' that - wraps GCC's `fastcall' function attribute. The conditional - code can be easilly adapted to other compilers that support a - similar feature. - - The name is also added to the file's undef_list. - """ - - self.undef_list.append("FASTCALL") - print("""# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) -# define FASTCALL __attribute__((fastcall)) -# else -# define FASTCALL -# endif""") - return - - def printVisibility(self, S, s): """Conditionally define visibility function attribute.