From 10ceb8bb3d90190e304e5322ef3d8c4006b2bf79 Mon Sep 17 00:00:00 2001 From: Todd White Date: Mon, 13 Apr 2026 16:38:14 -0400 Subject: [PATCH] fix(build): hoist GL_GLEXT_PROTOTYPES out of __APPLE__ branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CABackingStore.h only set GL_GLEXT_PROTOTYPES inside the __APPLE__ branch. On Linux (and every other non-Apple platform), was imported without the define, then it transitively included which set its include guard without emitting any OpenGL 2.0+ prototypes. CARenderer.m's later import of was then a no-op, so glUseProgram and friends ended up as implicit declarations — an error under clang 16+. Move the define above the platform split so every backend gets prototypes emitted on first glext.h traversal. No behavioral change on Windows or macOS; Linux now compiles cleanly against Mesa. Co-Authored-By: Claude Opus 4.6 (1M context) --- Source/CABackingStore.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/CABackingStore.h b/Source/CABackingStore.h index 10693c1..efb4a3c 100644 --- a/Source/CABackingStore.h +++ b/Source/CABackingStore.h @@ -38,8 +38,15 @@ #if GNUSTEP #import #endif -#if (__APPLE__) +/* GL_GLEXT_PROTOTYPES must be defined BEFORE is included so that + * when gl.h transitively pulls in glext.h, the OpenGL 2.0+ prototypes + * (glUseProgram etc.) are declared. Previously this define was inside the + * __APPLE__ branch, so the Linux build of CARenderer.m saw an undefined + * glUseProgram and failed on modern clang (which treats implicit function + * declarations as errors). + */ #define GL_GLEXT_PROTOTYPES 1 +#if (__APPLE__) #import #import #import