From 3aa479fbec9ea2859a74f0b531f2c8935092f8be Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 1 Feb 2024 09:52:53 -0800 Subject: [PATCH] Avoid redundant function declarations in gl.c. NFC --- system/lib/gl/gl.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/system/lib/gl/gl.c b/system/lib/gl/gl.c index 13dfe170bd41..bbd7a95483b7 100644 --- a/system/lib/gl/gl.c +++ b/system/lib/gl/gl.c @@ -5,16 +5,21 @@ * found in the LICENSE file. */ +#if GL_ENABLE_GET_PROC_ADDRESS + // GL proc address retrieval #include #include #include +#include #define GL_GLEXT_PROTOTYPES #include #include +#ifdef LEGACY_GL_EMULATION + #include // Define emscripten_ versions of gl functions, to avoid name collisions @@ -1569,15 +1574,6 @@ GLAPI void APIENTRY emscripten_glGetObjectParameteriv (GLhandleARB obj, GLenum p GLAPI void APIENTRY emscripten_glGetInfoLog (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); GLAPI void APIENTRY emscripten_glBindProgram (GLenum target, GLuint program); -#if GL_ENABLE_GET_PROC_ADDRESS - -extern void *emscripten_webgl1_get_proc_address(const char *name); -extern void *_webgl1_match_ext_proc_address_without_suffix(const char *name); -extern void *emscripten_webgl2_get_proc_address(const char *name); -extern void *_webgl2_match_ext_proc_address_without_suffix(const char *name); - -#ifdef LEGACY_GL_EMULATION - #define RETURN_GL_EMU_FN(functionName) if (!strcmp(name, #functionName)) return emscripten_##functionName; void* emscripten_legacy_gl_emulation_GetProcAddress(const char *name) { @@ -1795,6 +1791,9 @@ for line in open('a').readlines(): } #endif +void *_webgl1_match_ext_proc_address_without_suffix(const char *name); +void *_webgl2_match_ext_proc_address_without_suffix(const char *name); + // "Sloppy" desktop OpenGL/mobile GLES emulating // behavior: different functionality is available under // different vendor suffixes. In emscripten_GetProcAddress()