artemp/mapnik — Issue #693: Patch - Detect Windows build using the _WIN32 macro
Author: artemp
Created: 2011-10-11 16:32:43+00:00
State: open
Labels: Core_Library

The MSVC cmath.h doesn't have a rint() function. Therefore, mapnik's global.hpp has its own version. This is included only when _WINDOWS is set. However, this has to be set by the build environment. The 'standard' (recommended) way to test if we're on Windows is by checking against _WIN32. This patch adds that check.

I'm not sure if Windows compilers other than MSVC define this variable. Therefore I left in the _WINDOWS test that was there before. Technically other compilers don't 'need' to support it; on the other hand, if there are any that don't, it may still be better to require the build environment _WIN32 rather than _WINDOWS, since it's used in more places. I don't see urgent reasons to choose on over the other, it's just an idea.

_WIN32 is set in both 32 and 64-bit builds, the name is historical.