mapi/glx: Remove FASTCALL/PURE

This isn't worth the complexity.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33623>
This commit is contained in:
Adam Jackson
2025-02-18 12:04:18 -05:00
committed by Marge Bot
parent 32a10ccbdd
commit 244c9cc45e
3 changed files with 9 additions and 58 deletions
+5 -7
View File
@@ -176,7 +176,6 @@ class PrintGlxProtoStubs(glX_proto_common.glx_print_proto):
print('#include <limits.h>')
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 <idr@us.ibm.com>
*/
""")
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 );
""")
+4 -12
View File
@@ -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 <X11/Xfuncproto.h>')
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):
-39
View File
@@ -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.