Make variable accessor functions the same across all modules for %extend with member variables to work consistently across all language modules and as documented. Use -oldvarnames commandline option to get the original variable names.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7313 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
233f1ab7e6
commit
8eb7e528b0
4 changed files with 41 additions and 13 deletions
|
|
@ -27,6 +27,7 @@ static const char *usage = (char*)
|
|||
"-prefix <name> - Set a prefix <name> to be prepended to all names\n"
|
||||
"-where - Emit library location\n"
|
||||
"-suffix <name> - Change .cxx to something else\n"
|
||||
"-oldvarnames - old intermediary method names for variable wrappers\n"
|
||||
"\n");
|
||||
|
||||
static int classmode = 0;
|
||||
|
|
@ -36,6 +37,7 @@ static int static_member_function = 0;
|
|||
static int generate_sizeof = 0;
|
||||
static char *prefix=0;
|
||||
static char *ocaml_path=(char*)"ocaml";
|
||||
static bool old_variable_names = false;
|
||||
static String *classname=0;
|
||||
static String *module=0;
|
||||
static String *init_func_def = 0;
|
||||
|
|
@ -131,6 +133,9 @@ public:
|
|||
i++;
|
||||
} else
|
||||
Swig_arg_error();
|
||||
} else if (strcmp(argv[i],"-oldvarnames") == 0) {
|
||||
Swig_mark_arg(i);
|
||||
old_variable_names = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -269,8 +274,10 @@ public:
|
|||
Swig_register_filebyname("classtemplate",f_classtemplate);
|
||||
Swig_register_filebyname("class_ctors",f_class_ctors);
|
||||
|
||||
Swig_name_register("set","%v__set__");
|
||||
Swig_name_register("get","%v__get__");
|
||||
if (old_variable_names) {
|
||||
Swig_name_register("set","%v__set__");
|
||||
Swig_name_register("get","%v__get__");
|
||||
}
|
||||
|
||||
Printf( f_runtime,
|
||||
"/* -*- buffer-read-only: t -*- vi: set ro: */\n" );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue