about summary refs log tree commit diff stats
path: root/wrapperhelper/src/parse.c
diff options
context:
space:
mode:
authorrajdakin <rajdakin@gmail.com>2024-11-25 16:13:04 +0100
committerGitHub <noreply@github.com>2024-11-25 16:13:04 +0100
commita71856801b2a9f36a8745d0285778e6654a3408d (patch)
tree51eeb8947ea7e321ff98f29b81c800446391924d /wrapperhelper/src/parse.c
parent84608fc581546076d6a34ae18c864eb8cde6ddae (diff)
downloadbox64-a71856801b2a9f36a8745d0285778e6654a3408d.tar.gz
box64-a71856801b2a9f36a8745d0285778e6654a3408d.zip
[WRAPPERHELPER] Added the `--gst` option (#2072)
Diffstat (limited to 'wrapperhelper/src/parse.c')
-rw-r--r--wrapperhelper/src/parse.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/wrapperhelper/src/parse.c b/wrapperhelper/src/parse.c
index 398fd75b..75060484 100644
--- a/wrapperhelper/src/parse.c
+++ b/wrapperhelper/src/parse.c
@@ -1431,6 +1431,8 @@ static int eval_expression(loginfo_t *li, machine_t *target, expr_t *e, khash_t(
 	}
 }
 
+extern int is_gst; // If 1, mark structures _G*Class as simple
+
 // declaration-specifier with storage != NULL
 // specifier-qualifier-list + static_assert-declaration with storage == NULL
 static int parse_declaration_specifier(machine_t *target, khash_t(struct_map) *struct_map, khash_t(type_map) *type_map, khash_t(type_map) *enum_map,
@@ -2047,6 +2049,13 @@ parse_cur_token_decl:
 			typ->val.st->nmembers = vector_size(st_members, members);
 			typ->val.st->members = vector_steal(st_members, members);
 			typ->val.st->is_defined = 1;
+			if (is_gst
+			       && typ->val.st->tag
+			       && (string_len(typ->val.st->tag) >= 7)
+			       && !strncmp(string_content(typ->val.st->tag), "_G", 2)
+			       && !strcmp(string_content(typ->val.st->tag) + string_len(typ->val.st->tag) - 5, "Class")) {
+				typ->val.st->is_simple = 1;
+			}
 			*tok = proc_next_token(prep);
 			goto parse_cur_token_decl;
 		} else {