Handle undefined TARGET_OS_OSX correctly
Older versions of macOS do not define this macro at all, while the iOS, watchOS etc. SDKs always define it to 0. So we are targeting macOS if it is either undefined or defined to 1. Newer versions of clang will actually error if you use an undefined macro that starts with TARGET_OS without checking if it is defined.