Use built-in __APPLE__ macro instead of MACOSX

GCC and Clang on Mac OS have a built-in __APPLE__ macro. Use it instead of
manually-defined MACOSX.
Use _WIN32 instead of WIN32 to check for Windows

MinGW defines both _WIN32 and WIN32 (and may even be the only compiler
doing so). Microsoft and Intel compilers only define _WIN32. Use the
common one to eliminate the need in defining WIN32 explicitly.
Merge remote branch 'mikedld/remove-macosx-macro'