Allow customizing type mangling in SWIG preprocessor

Use the "type" naming format for the types mangled by "#@" and "##@"
preprocessor operators, in order to allow customizing them for a
particular backend.

This isn't used by any backend yet, so this doesn't change anything so
far.
This commit is contained in:
Vadim Zeitlin 2021-11-10 00:30:22 +01:00
commit 5bf1497d7b
3 changed files with 30 additions and 2 deletions

View file

@ -929,14 +929,14 @@ static String *expand_macro(String *name, List *args, String *line_file) {
/* Non-standard mangle expansions.
The #@Name is replaced by mangle_arg(Name). */
if (strstr(Char(ns), "\004")) {
String *marg = Swig_string_mangle(arg);
String *marg = Swig_name_type(arg);
Clear(temp);
Printf(temp, "\004%s", aname);
Replace(ns, temp, marg, DOH_REPLACE_ID_END);
Delete(marg);
}
if (strstr(Char(ns), "\005")) {
String *marg = Swig_string_mangle(arg);
String *marg = Swig_name_type(arg);
Clear(temp);
Clear(tempa);
Printf(temp, "\005%s", aname);