put __APPLE__ before BSD