__unix__ not defined on Mac - add __APPLE__