forked from lda/telodendria
Add support for return types that are const, structs, or enums.
This commit is contained in:
parent
6e976a2b8d
commit
95cb14213f
1 changed files with 12 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue