Turn run-time checks into compile-time ones

Instead of doing a runtime switch on operating system type, #ifdef it.