You can simply write:
#elif defined X
Which should be compatible with all ANSI-C compatible compilers.