build: Convert mad detection to new macros.