check if __APPLE__ is defined

The other os should be added if you want this to work as well