
There is no standardized way of determining what OS you are compiling for. However, _WIN32 seems more common than WIN32. See, e.g. here: http://sourceforge.net/p/predef/wiki/OperatingSystems/ So, we should be able to change all WIN32 to _WIN32 and improve compatibility. The standard Windows build system (btool/build.xml) explicitly defines WIN32 in config.h.
That's correct. Also note that Microsoft's compiler does *not *define __WIN32__, so we should stop checking for that as well.
About M_PI, <2geom/angle.h> defines it if it is not already defined. If
there are many other constants needed (Liam mentioned sqrt(2)), we could add <geom/constants.h> file to collect all those. Regardless, I think you cannot escape modifying the source code, or temporarily adding the missing defines to the gcc cmdline.
Looks like we need, at a bare minimum: M_PI M_PI_2 M_SQRT2 (this is the default zoom factor in Inkscape)
Although defining others http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx would be great, too.