add preprocessor ifdefs for compatibility with vstudio.