Attached is a patch fixing the Windows build under MSVC. Due to the fact that MSVC is not C99 compliant, and much of the source uses C99 features, I had to compile the code as C++ under MSVC. This resulted in a number of issues related to implicit type conversion mostly between int and the various enum types. I have fixed these by making type conversions more explicit where necessary and changing a few function signatures to use appropriate types. I also added C++ operator overloads to msw/compat.h for ++, --, +=, and -= to allow these operations to be applied to the enum types. Finally, all of the platform_* functions for Windows were named incorrectly, so I corrected them, and added a few missing platform_* functions.
The result of this patch is a much more type-safe body of code. I have tried to change all platform_* function signatures for linux, macosx and juju, but am not positive that these will currently compile correctly as I do not have access to these platforms to test.