Fix define with single line comment

This commit is contained in:
drmortalwombat 2022-05-08 21:44:28 +02:00
parent 75e5471dd1
commit d7b0e54494

View File

@ -533,10 +533,14 @@ void Scanner::NextToken(void)
mErrors->Error(mLocation, EERR_INVALID_PREPROCESSOR, "')' expected in defined parameter list"); mErrors->Error(mLocation, EERR_INVALID_PREPROCESSOR, "')' expected in defined parameter list");
} }
macro->SetString(mLine + mOffset); int slen = mOffset;
int slen = strlen(mLine + mOffset); while (mLine[slen] && mLine[slen] != '/' && mLine[slen + 1] != '/')
slen++;
macro->SetString(mLine + mOffset, slen - mOffset);
mDefines->Insert(macro); mDefines->Insert(macro);
mOffset += slen; mOffset = slen;
while (mLine[mOffset])
mOffset++;
} }
} }
else if (mToken == TK_PREP_UNDEF) else if (mToken == TK_PREP_UNDEF)