Add support for extern "C" thread_local

This commit is contained in:
William S Fulton 2013-02-08 18:45:29 +00:00
commit e44656cfe5
8 changed files with 36 additions and 6 deletions

View file

@ -1491,8 +1491,9 @@ static void new_feature(const char *featurename, String *val, Hash *featureattri
/* check if a function declaration is a plain C object */
static int is_cfunction(Node *n) {
if (!cparse_cplusplus || cparse_externc) return 1;
if (Cmp(Getattr(n,"storage"),"externc") == 0) {
if (!cparse_cplusplus || cparse_externc)
return 1;
if (Swig_storage_isexternc(n)) {
return 1;
}
return 0;
@ -5034,6 +5035,14 @@ storage_class : EXTERN { $$ = "extern"; }
$$ = 0;
}
}
| EXTERN string THREAD_LOCAL {
if (strcmp($2,"C") == 0) {
$$ = "externc thread_local";
} else {
Swig_warning(WARN_PARSE_UNDEFINED_EXTERN,cparse_file, cparse_line,"Unrecognized extern type \"%s\".\n", $2);
$$ = 0;
}
}
| STATIC { $$ = "static"; }
| TYPEDEF { $$ = "typedef"; }
| VIRTUAL { $$ = "virtual"; }