Replaced #ifdef with logical #if defined