From 125c899d62b4a0a5791b37f644ebd19543cb4e55 Mon Sep 17 00:00:00 2001 From: Isaiah <16439221+pisaiah@users.noreply.github.com> Date: Thu, 19 Jun 2025 03:23:37 -0400 Subject: [PATCH] thirdparty: add NDEBUG check before glGetErrorCode if-statement in sokol_gfx.h (#24754) --- thirdparty/sokol/sokol_gfx.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/thirdparty/sokol/sokol_gfx.h b/thirdparty/sokol/sokol_gfx.h index 08277b7b1b..a33025ff17 100644 --- a/thirdparty/sokol/sokol_gfx.h +++ b/thirdparty/sokol/sokol_gfx.h @@ -4878,7 +4878,11 @@ inline int sg_append_buffer(sg_buffer buf_id, const sg_range& data) { return sg_ #endif #ifndef _SG_GL_CHECK_ERROR // __v_ start + #ifdef NDEBUG + #define _SG_GL_CHECK_ERROR() (void)(0) + #else #define _SG_GL_CHECK_ERROR() { int glerr = glGetError(); if(glerr){ fprintf(stderr, ">> glGetError: %d\n", glerr); }; SOKOL_ASSERT(glerr == GL_NO_ERROR); } + #endif // __v_ end #endif #endif