Preserve thread_local for brace-enclosed extern "C"

This commit is contained in:
Seth R Johnson 2022-02-10 07:33:09 -05:00 • committed by Olly Betts
commit 14c0942505

View file

@ -3133,7 +3133,14 @@ c_declaration : c_decl {
Setattr($$,"name",$2); Setattr($$,"name",$2);
appendChild($$,n); appendChild($$,n);
while (n) { while (n) {
if (!Equal(Getattr(n, "storage"), "typedef")) { String *s = Getattr(n, "storage");
if (s) {
if (Strstr(s, "thread_local")) {
Insert(s,0,"externc ");
} else if (!Equal(s, "typedef")) {
Setattr(n,"storage","externc");
}
} else {
Setattr(n,"storage","externc"); Setattr(n,"storage","externc");
} }
n = nextSibling(n); n = nextSibling(n);