Add support for return types that are const, structs, or enums.

This commit is contained in:
Jordan Bancino 2023-04-27 16:02:15 +00:00
parent 6e976a2b8d
commit 95cb14213f

View file

@ -482,6 +482,18 @@ HeaderParse(Stream * stream, HeaderExpr * expr)
expr->type = HP_DECLARATION;
strncpy(expr->data.declaration.returnType, word, wordLimit);
if (strcmp(word, "struct") == 0 ||
strcmp(word, "enum") == 0 ||
strcmp(word, "const") == 0)
{
Free(word);
word = HeaderConsumeWord(expr);
wordLen = strlen(word);
expr->data.declaration.returnType[i] = ' ';
strncpy(expr->data.declaration.returnType + i + 1, word, wordLen + 1);
i += wordLen + 1;
}
Free(word);
c = HeaderConsumeWhitespace(expr);