From 53768c84d66b2c68d165185d437a40c1eb262a29 Mon Sep 17 00:00:00 2001 From: FOTMarut Date: Sat, 2 May 2020 17:14:45 +0200 Subject: [PATCH] ref_gl: de-duplicate GL function definitions - Used APIENTRY_LINKAGE in ref_gl to remove duplicate definitions of GL functions among translation units - Fixes building ref_gl with -fno-common (GCC 10) --- ref_gl/gl_context.c | 2 ++ ref_gl/gl_export.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ref_gl/gl_context.c b/ref_gl/gl_context.c index 7581d648..19cec68e 100644 --- a/ref_gl/gl_context.c +++ b/ref_gl/gl_context.c @@ -13,6 +13,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ +// GL API function pointers, if any, reside in this translation unit +#define APIENTRY_LINKAGE #include "gl_local.h" #include "gl_export.h" diff --git a/ref_gl/gl_export.h b/ref_gl/gl_export.h index 8aee249f..20817fa3 100644 --- a/ref_gl/gl_export.h +++ b/ref_gl/gl_export.h @@ -20,7 +20,7 @@ GNU General Public License for more details. #endif #ifndef APIENTRY_LINKAGE -#define APIENTRY_LINKAGE +#define APIENTRY_LINKAGE extern #endif #if defined XASH_NANOGL || defined XASH_WES || defined XASH_REGAL