From 95cb14213f37e9f59b840abe743ba85d3ddc7fd5 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Thu, 27 Apr 2023 16:02:15 +0000 Subject: [PATCH] Add support for return types that are const, structs, or enums. --- src/HeaderParser.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/HeaderParser.c b/src/HeaderParser.c index 959908f..f7ce346 100644 --- a/src/HeaderParser.c +++ b/src/HeaderParser.c @@ -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);