Handling leading "!" in #if

This commit is contained in:
Pierre Pronchery 2009-08-01 12:17:04 +00:00
parent 33269a5353
commit 01a4c6be8c

View File

@ -243,6 +243,9 @@ static CppScope _if_do(Cpp * cpp, char const * str)
if(str == NULL)
/* FIXME it's probably an error case instead */
return CPP_SCOPE_NOTYET;
if(str[0] == '!')
return (_if_do(cpp, &str[1]) == CPP_SCOPE_TAKING)
? CPP_SCOPE_NOTYET : CPP_SCOPE_TAKING;
if(strcmp(str, "1") == 0)
return CPP_SCOPE_TAKING;
if(strncmp(str, "defined(", 8) == 0 && (p = strchr(str, ')')) != NULL)