Add #ifdef around __attribute__.