(OSX) Move code over to platform_apple.c