pioneerspacesim/pioneer — Issue #636: windows.h should be hidden in a single translation unit
Author: johnbartholomew
Created: 2011-10-08 21:05:38+00:00
State: open

Even when `WIN32_LEAN_AND_MEAN` is defined, along with `NOMINMAX` (and there are a few other NO* macros that could be defined), `windows.h` still renames a whole load of tokens, such as `RegisterClass`, which is used by `LuaObject`. This is a pain in the ass (in `LuaObject.h` it checks for `_WIN32` and pulls in `libs.h` if it's defined so that `LuaObject::RegisterClass` actually gets renamed, to match the rename that happens wherever it's called).

Since the code is cross-platform anyway, we should just find the few bits of WinAPI specific pieces and extract them into a file (if they're not already separated out). That file can include `windows.h`, and it can be removed from `libs.h` so that it doesn't pollute the global namespace for the entire code-base.