fix OS X build issues

Changes required to be able to build Retro on OS X. I've tested the build in Linux and also Windows to make sure I haven't broken anything there with these changes.