Changed the #undef to work in terms of __APPLE__, because windows defines are less standard.