add missing #ifdef DETECT_DEVICE