[WRAPPERHELPER] Added legacy __attribute support (#2996)

This commit is contained in:
Yang Liu
2025-09-02 18:02:42 +08:00
committed by GitHub
parent 994ce41adc
commit 28d07f9bf0
2 changed files with 2 additions and 1 deletions

View File

@@ -1,2 +1,3 @@
// Ignore all attributes
#define __attribute__(_)
#define __attribute(_)

View File

@@ -2129,7 +2129,7 @@ parse_cur_token_decl:
}
char *ident = string_steal(tok->tokv.str);
*tok = proc_next_token(prep);
while ((tok->tokt == PTOK_IDENT) && !strcmp(string_content(tok->tokv.str), "__attribute__")) {
while ((tok->tokt == PTOK_IDENT) && (!strcmp(string_content(tok->tokv.str), "__attribute__") || !strcmp(string_content(tok->tokv.str), "__attribute"))) {
// Attribute
string_del(tok->tokv.str);
*tok = proc_next_token(prep);