fixup DIAG_{ON,OFF} to get rid of compiler errors
about not using #pragmas inside functions