5 ms·
This is my favorite macro: "#define WIN32_LEAN_AND_MEAN" Why is it that even though Github or what ever has cutsie unicorns (or whatever it is) as error messag
by rightbyte 3y ago
This is my favorite macro:
"#define WIN32_LEAN_AND_MEAN"
Why is it that even though Github or what ever has cutsie unicorns (or whatever it is) as error messages it feels fake and contrived while this define just feels like some random dude at MS naming it before going off to write Solitaire?
- hoten 3y agoDon't forget `WIN32_EXTRA_LEAN`! Still no idea what that does/did. For those curious about WIN32_LEAN_AND_MEAN - it reduces compile time by not auto-including a number of windows headers: https://devblogs.microsoft.com/oldnewthing/20091130-00/?p=15863 https://devblogs.microsoft.com/oldnewthing/20091130-00/?p=15...
- dataflow 3y agoDo you mean VC_EXTRALEAN? Or is WIN32_EXTRA_LEAN also a thing?
- TeMPOraL 3y agoFirst time I hear of VC_EXTRALEAN, always used WIN32_EXTRA_LEAN.
- nikbackm 3y agoThe bad news is that WIN32_EXTRA_LEAN has no effect, you have to define VC_EXTRALEAN if you want to exclude extra stuff from the MFC and VC headers. The good news is also that it has no effect. :) You can verify this for yourself by grepping the Visual Studio headers for VC_EXTRALEAN and WIN32_EXTRA_LEAN.
- Tempest1981 3y agoBut it did in 2005? > VC_EXTRALEAN defines WIN32_LEAN_AND_MEAN and a number of NOservice definitions, such as NOCOMM and NOSOUND. > https://gamedev.net/forums/topic/367942-win32_lean_and_mean-vs-vc_extralean/3423682/ https://gamedev.net/forums/topic/367942-win32_lean_and_mean-...
- nikbackm 3y agoWIN32_EXTRA_LEAN != WIN32_LEAN_AND_MEAN
- deleted 3y ago[deleted]
- Night_Thastus 3y agoWe've had to use this at my work a couple times. I forget the exact reasoning, but IIRC if you're using including parts of the Win32 API, you get some things that would stomp on C or C++ names, which is bad. Macros like that one prevent loading things you don't want. One example was min and max - Win32 includes those which messes with trying to use std::min and std::max.
- dataflow 3y agoThere's NOMINMAX, NOGDI, etc. for that.
- smileybarry 3y agoI think we had to use that when importing FDI.h (the CAB-extracting part of winapi) to avoid it bringing more legacy cruft.
- jcelerier 3y agonot only min, max, other "fun" ones to debug are "near", "far", "small"
- ghosty141 3y agoAs always, Raymond Chen wrote about it! https://devblogs.microsoft.com/oldnewthing/20091130-00/?p=15863 https://devblogs.microsoft.com/oldnewthing/20091130-00/?p=15... Its also my favorite btw.
- LexiMax 3y agoI've always been a fan of _CRT_SECURE_NO_WARNINGS, personally.
- lmm 3y agoProbably because you're the same generation as the dude at MS, whereas you want the kids at Github to get off your lawn?