From af69df15e18ea57779b33e52892de086c7f73f8e Mon Sep 17 00:00:00 2001 From: lewa_j Date: Sun, 27 Jul 2025 01:06:03 +0300 Subject: [PATCH] ref: Fix gl4es build under windows. Static gl functions declared with APIENTRY even without mangling. --- ref/gl/gl_export.h | 2 +- ref/gl/gl_opengl.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ref/gl/gl_export.h b/ref/gl/gl_export.h index d261985d..0b167513 100644 --- a/ref/gl/gl_export.h +++ b/ref/gl/gl_export.h @@ -902,7 +902,7 @@ typedef float GLmatrix[16]; #endif #if XASH_GL_STATIC && !REF_GL_KEEP_MANGLED_FUNCTIONS - #define GL_FUNCTION( name ) name + #define GL_FUNCTION( name ) APIENTRY name #elif XASH_GL_STATIC && REF_GL_KEEP_MANGLED_FUNCTIONS #define GL_FUNCTION( name ) APIENTRY p##name #else diff --git a/ref/gl/gl_opengl.c b/ref/gl/gl_opengl.c index 04b43e26..f3708b45 100644 --- a/ref/gl/gl_opengl.c +++ b/ref/gl/gl_opengl.c @@ -1490,13 +1490,13 @@ void GL_SetupAttributes( int safegl ) void wes_init( const char *gles2 ); int nanoGL_Init( void ); #if XASH_GL4ES -static void GL4ES_GetMainFBSize( int *width, int *height ) +static void APIENTRY GL4ES_GetMainFBSize( int *width, int *height ) { *width = gpGlobals->width; *height = gpGlobals->height; } -static void *GL4ES_GetProcAddress( const char *name ) +static void * APIENTRY GL4ES_GetProcAddress( const char *name ) { if( !Q_strcmp(name, "glShadeModel") ) // combined gles/gles2/gl implementation exports this, but it is invalid