Differentiate between OSX and iOS

__APPLE__ is defined for both iOS and OSX.  When compiling for iOS this leads to including crt_externs.h which is not available on iOS.
Merge pull request #631 from aschepis/master

Differentiate between OSX and iOS