properly check constant if defined