Preprocessor #if statement doesn't work

If you WANT to have symbol definitions for your #defines, you can "cheat" by pre-defining all of your symbolic names with unique numeric values, off in some .h file. Such as:

//testnames.h
#define pillo 0x12340001
#define pollo 0x12340002
//main.c
#include "testnames.h"
#define TEST pillo
  : 
#if TEST == pillo
 // stuff.
#elif TEST == pollo
 // other stuff
#else
  #error undefined test
#endif

the current Optiboot source code uses this extensively to allow compile time naming of chip pins like avr-gcc optiboot.c -DLED=B5 -DUARTRX=D0 and similar. It's "ugly" in the implementation (10 ports with ~8 bits each makes for #elif chains 500+ lines long!), but it's not difficult to implement (a good editor with macro capabilities helps a lot), and it makes things much easier for the "user."