[12709] Add some safety to some preprocessor defines (original author @Schmoozerd)