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

@ -148,7 +148,7 @@ int CLISP::top(Node *n) {
int CLISP::functionWrapper(Node *n) {
is_function = 1;
String *storage = Getattr(n, "storage");
if (!extern_all_flag && (!storage || (!Swig_storage_isextern(n) && Strcmp(storage, "externc"))))
if (!extern_all_flag && (!storage || (!Swig_storage_isextern(n) && !Swig_storage_isexternc(n))))
return SWIG_OK;
String *func_name = Getattr(n, "sym:name");
@ -217,10 +217,9 @@ int CLISP::constantWrapper(Node *n) {
int CLISP::variableWrapper(Node *n) {
is_function = 0;
// SwigType *type=;
String *storage = Getattr(n, "storage");
if (!extern_all_flag && (!storage || (!Swig_storage_isextern(n) && Strcmp(storage, "externc"))))
if (!extern_all_flag && (!storage || (!Swig_storage_isextern(n) && !Swig_storage_isexternc(n))))
return SWIG_OK;
String *var_name = Getattr(n, "sym:name");

View file

@ -985,7 +985,7 @@ int Language::cDeclaration(Node *n) {
}
}
Printf(f_header, ";\n");
} else if (Cmp(storage, "externc") == 0) {
} else if (Swig_storage_isexternc(n)) {
/* here 'extern "C"' is needed */
String *str = SwigType_str(ty, name);
Printf(f_header, "extern \"C\" %s;\n", str);