There are two possibilities, and I can't tell which. The most likely is that, because neither NVGA
nor VGA
is a #define
d macro, they are both evaluated as zero in #if
and therefore considered to be equal. (This is a rule of the language.) The second possibility is that your system's stdio.h
or conio.h
defines NVGA
to VGA
.
To find out which, compile this program and see what happens:
#include <stdio.h>
#include <conio.h>
/* these numbers are chosen at random */
#define NVGA 8446
#define VGA 13060
#define ADAPTER NVGA
int main(void)
{
#if ADAPTER == VGA
puts("VGA");
#else
puts("NOT VGA");
#endif
getch();
return 0;
}
If it produces the output you expected (i.e. "NOT VGA"), your problem is the first one. If you get an error about redefining NVGA
or VGA
, your problem is the second one.