I am trying to compare to a defined constants in C, and I have simplified my program to the following:
#include \"stdio.h\" #include \"stdlib.h\" #define INV
Remove the semicolon from your INVALID_VALUE definition.
Macros are replaced lexically (character-by-character) with no understanding of the syntax around them. Your macro INVALID_VALUE is set to -999;, so your if line expands the macro to:
-999;
if (test==-999;)
which is invalid C syntax.