You might try...
Code:
ASM
    ifndef __18F8722
        error "18F8722 not selected"
    endif
ENDASM
That's 2 underscores before the 18F.