This required the addition of a few exception handlers so to avoid #ifdef overuse I also added some #defines for non-Windows systems that allow using __try and __except directly in the code without #ifdef'ing them out.