From 3d83d144a361aee1bbaff00850f2efcd21683954 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Fri, 18 Oct 2019 16:49:12 +0100 Subject: [PATCH] OPENGL: Fix warning when using builtin OpenGL functions --- backends/graphics/opengl/context.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/graphics/opengl/context.cpp b/backends/graphics/opengl/context.cpp index 08f44969a7d..564007bd2c2 100644 --- a/backends/graphics/opengl/context.cpp +++ b/backends/graphics/opengl/context.cpp @@ -82,11 +82,11 @@ void OpenGLGraphicsManager::initializeGLContext() { // We use horrible trickery to silence C++ compilers. // See backends/plugins/sdl/sdl-provider.cpp for more information. assert(sizeof(void (*)()) == sizeof(void *)); - void *fn = nullptr; -#define LOAD_FUNC(name, loadName) \ - fn = getProcAddress(#loadName); \ - memcpy(&g_context.name, &fn, sizeof(fn)) +#define LOAD_FUNC(name, loadName) { \ + void *fn = getProcAddress(#loadName); \ + memcpy(&g_context.name, &fn, sizeof(fn)); \ +} #define GL_EXT_FUNC_DEF(ret, name, param) LOAD_FUNC(name, name)