Perform proper spacing in director method declarations

If a director method returns a const pointer, eg. 'int *const', then in its
method declaration a space has to be inserted between 'const' and the
method name.
This fixes swig#1810.
This commit is contained in:
Thomas Reitmayr 2020-06-14 14:46:03 +02:00
commit c259702314
3 changed files with 17 additions and 3 deletions

View file

@ -160,7 +160,7 @@ String *Swig_method_decl(SwigType *return_base_type, SwigType *decl, const_Strin
SwigType *rettype_stripped = SwigType_strip_qualifiers(rettype);
String *rtype = SwigType_str(rettype, 0);
Append(result, rtype);
if (SwigType_issimple(rettype_stripped) && return_base_type)
if ((SwigType_issimple(rettype_stripped) && return_base_type) || SwigType_isqualifier(rettype))
Append(result, " ");
Delete(rtype);
Delete(rettype_stripped);