Fix #2933129 - typemaps not being found when the unary scope operator (::) is used to denote global scope

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11827 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2010-01-22 20:39:54 +00:00
commit f112e4bac1
10 changed files with 290 additions and 30 deletions

View file

@ -1094,6 +1094,25 @@ void SwigType_typename_replace(SwigType *t, String *pat, String *rep) {
Delete(elem);
}
/* -----------------------------------------------------------------------------
* SwigType_remove_global_scope_prefix()
*
* Removes the unary scope operator (::) prefix indicating global scope in all
* components of the type
* ----------------------------------------------------------------------------- */
SwigType *SwigType_remove_global_scope_prefix(const SwigType *t) {
SwigType *result;
const char *type = Char(t);
if (strncmp(type, "::", 2) == 0)
type += 2;
result = NewString(type);
Replaceall(result, ".::", ".");
Replaceall(result, "(::", "(");
Replaceall(result, "enum ::", "enum ");
return result;
}
/* -----------------------------------------------------------------------------
* SwigType_check_decl()
*