From 3486c5707b921c0071b83cdad9ad3ea0c5b2fa03 Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Fri, 15 Apr 2016 02:02:59 +0000 Subject: [PATCH] Fix macro redefinition warning APIENTRY is unconditionally defined through windows.h while it already has been defined previously in oglpfuncs.h, resulting in a macro redefinition warning. In this case fix the warning by undefining the macro prior to including windows.h. --- samples/opengl/pyramid/oglpfuncs.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/samples/opengl/pyramid/oglpfuncs.cpp b/samples/opengl/pyramid/oglpfuncs.cpp index ac0f8ea27f..d1b6c4bece 100644 --- a/samples/opengl/pyramid/oglpfuncs.cpp +++ b/samples/opengl/pyramid/oglpfuncs.cpp @@ -18,6 +18,12 @@ #define WIN32_LEAN_AND_MEAN 1 #define LE_ME_ISDEF #endif + + /* + APIENTRY is defined in oglpfuncs.h as well as by windows.h. Undefine + it to prevent a macro redefinition warning. + */ + #undef APIENTRY #include //For wglGetProcAddress #ifdef LE_ME_ISDEF #undef WIN32_LEAN_AND_MEAN