Khronos Public Bugzilla
Bug 706 - Don't define WIN32_LEAN_AND_MEAN if is already defined
Don't define WIN32_LEAN_AND_MEAN if is already defined
Status: RESOLVED FIXED
Product: OpenGL
Classification: Unclassified
Component: Man Pages, Reference Card & Other Documentation
4.2
PC Windows
: P3 enhancement
: ---
Assigned To: Jon Leech
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-28 14:42 PDT by breakin
Modified: 2013-07-08 03:29 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description breakin 2012-08-28 14:42:16 PDT
In the version of glcorearb.h that I have there is a line

#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>

Sometimes WIN32_LEAN_AND_MEAN might already be defined and windows.h already included. Then a warning is generated in Visual Studio

glcorearb.h(59): warning C4005: 'WIN32_LEAN_AND_MEAN' : macro redefinition

A suggestion would be to have the following in the header instead

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <windows.h>

to suppress warning. I could disable the warning manually, but I like to keep warnings enabled.
Comment 1 Jon Leech 2013-07-08 03:29:44 PDT
This should be done in the new XML Registry-generated glcorearb.h now - thanks!