Preserve thread_local for brace-enclosed extern "C"
This commit is contained in:
parent
2ecc5bc214
commit
14c0942505
1 changed files with 10 additions and 3 deletions
|
|
@ -3133,15 +3133,22 @@ 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);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!Equal($2,"C++")) {
|
if (!Equal($2,"C++")) {
|
||||||
Swig_warning(WARN_PARSE_UNDEFINED_EXTERN,cparse_file, cparse_line,"Unrecognized extern type \"%s\".\n", $2);
|
Swig_warning(WARN_PARSE_UNDEFINED_EXTERN,cparse_file, cparse_line,"Unrecognized extern type \"%s\".\n", $2);
|
||||||
}
|
}
|
||||||
$$ = new_node("extern");
|
$$ = new_node("extern");
|
||||||
Setattr($$,"name",$2);
|
Setattr($$,"name",$2);
|
||||||
appendChild($$,firstChild($5));
|
appendChild($$,firstChild($5));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue