Feature/fix cross compilation

I'm not entirely sure what this does on Windows or Mac (in part because I had to fix a bunch of merge conflicts), but it is not supposed to affect anything. It does enable me to compile with mingw and a few other compilers.