diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2013-02-08 07:38:10 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2013-02-08 07:38:10 +0000 |
commit | 7fcfdeee0837fb240fb30c521a9471de6e0e7bfa (patch) | |
tree | 0d17ad2556ac0f64bda3703226bc1457a806c4d3 /Source/Swig | |
parent | b725625e6fc29fc38e561f1c8455f4559add4d5e (diff) | |
download | swig-7fcfdeee0837fb240fb30c521a9471de6e0e7bfa.tar.gz |
Fixes detecting if a variable is extern when using 'extern thread_local'
Diffstat (limited to 'Source/Swig')
-rw-r--r-- | Source/Swig/misc.c | 11 | ||||
-rw-r--r-- | Source/Swig/swig.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Source/Swig/misc.c b/Source/Swig/misc.c index 1b8d79daf..297d1ccdc 100644 --- a/Source/Swig/misc.c +++ b/Source/Swig/misc.c @@ -263,6 +263,17 @@ void Swig_filename_unescape(String *filename) { } /* ----------------------------------------------------------------------------- + * Swig_storage_isextern() + * + * Determine if the storage class specifier is extern (but not externc) + * ----------------------------------------------------------------------------- */ + +int Swig_storage_isextern(Node *n) { + const String *storage = Getattr(n, "storage"); + return storage ? Strcmp(storage, "extern") == 0 || Strncmp(storage, "extern ", 7) == 0 : 0; +} + +/* ----------------------------------------------------------------------------- * Swig_storage_isstatic_custom() * * Determine if the storage class specifier is static diff --git a/Source/Swig/swig.h b/Source/Swig/swig.h index eccc18308..85d8c0b3e 100644 --- a/Source/Swig/swig.h +++ b/Source/Swig/swig.h @@ -315,6 +315,7 @@ extern int ParmList_is_compactdefargs(ParmList *p); extern void Swig_filename_correct(String *filename); extern String *Swig_filename_escape(String *filename); extern void Swig_filename_unescape(String *filename); + extern int Swig_storage_isextern(Node *n); extern int Swig_storage_isstatic_custom(Node *n, const_String_or_char_ptr storage); extern int Swig_storage_isstatic(Node *n); extern String *Swig_string_escape(String *s); |