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`.