added some c preprocessor checking