Compile-able on vs2012

2012 compile-able now.
Should work on mac if #define __APPLE__