remove old patch for features + def arg, but save the ignore/rename part. Now everything seems to be working.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6668 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f8b0ee3746
commit
32b724e75c
3 changed files with 47 additions and 32 deletions
|
|
@ -1088,12 +1088,7 @@ static int is_cfunction(Node *n) {
|
|||
* The additional functions form a linked list of nodes with the head being the original Node n. */
|
||||
static void default_arguments(Node *n) {
|
||||
Node *function = n;
|
||||
#ifdef MARCELO
|
||||
String *fname = 0;
|
||||
String *oname = 0;
|
||||
SwigType *fdecl = 0;
|
||||
int ignore = 0;
|
||||
#endif
|
||||
SwigType *fdecl = Getattr(function,"decl");
|
||||
|
||||
/* Do not add in functions if kwargs is being used or if user wants old default argument wrapping
|
||||
(one wrapped method per function irrespective of number of default arguments) */
|
||||
|
|
@ -1109,20 +1104,17 @@ static void default_arguments(Node *n) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef MARCELO
|
||||
if (function) {
|
||||
fdecl = Getattr(function,"decl");
|
||||
/* try to see if we need to ignore this method */
|
||||
fname = Getattr(function,"name");
|
||||
oname = make_name(fname,fdecl);
|
||||
if (strncmp(Char(oname),"$ignore",7) == 0) {
|
||||
ignore = 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
while (function) {
|
||||
ParmList *parms = Getattr(function,"parms");
|
||||
|
||||
/* try to see if we need to ignore this method */
|
||||
int ignore = 0;
|
||||
String *oname = make_name(Getattr(function,"name"), fdecl);
|
||||
if (strncmp(Char(oname),"$ignore",7) == 0) {
|
||||
ignore = 1;
|
||||
oname = 0;
|
||||
}
|
||||
|
||||
if (ParmList_has_defaultargs(parms)) {
|
||||
|
||||
/* Create a parameter list for the new function by copying all
|
||||
|
|
@ -1132,11 +1124,7 @@ static void default_arguments(Node *n) {
|
|||
/* Create new function and add to symbol table */
|
||||
{
|
||||
Node *new_function = new_node(Copy(nodeType(function)));
|
||||
#ifdef MARCELO
|
||||
SwigType *decl = Copy(fdecl);
|
||||
#else
|
||||
SwigType *decl = Copy(Getattr(function,"decl"));
|
||||
#endif
|
||||
int constqualifier = SwigType_isconst(decl);
|
||||
|
||||
Delete(SwigType_pop_function(decl)); /* remove the old parameter list from decl */
|
||||
|
|
@ -1144,11 +1132,7 @@ static void default_arguments(Node *n) {
|
|||
if (constqualifier)
|
||||
SwigType_add_qualifier(decl,"const");
|
||||
|
||||
#ifdef MARCELO
|
||||
Setattr(new_function,"name",fname);
|
||||
#else
|
||||
Setattr(new_function,"name",Getattr(function,"name"));
|
||||
#endif
|
||||
Setattr(new_function,"code",Copy(Getattr(function,"code")));
|
||||
Setattr(new_function,"decl", decl);
|
||||
Setattr(new_function,"parms",newparms);
|
||||
|
|
@ -1171,13 +1155,12 @@ static void default_arguments(Node *n) {
|
|||
if (templateparms) Setattr(new_function,"templateparms",CopyParmList(templateparms));
|
||||
}
|
||||
|
||||
#ifdef MARCELO
|
||||
/* apply the original function features */
|
||||
Swig_features_get(Swig_cparse_features(),Namespaceprefix,fname,fdecl,new_function);
|
||||
if (ignore) Setattr(new_function,"feature:ignore","1");
|
||||
#endif
|
||||
|
||||
add_symbols(new_function);
|
||||
yyrename = oname;
|
||||
add_symbols(new_function);
|
||||
yyrename = 0;
|
||||
|
||||
/* mark added functions as ones with overloaded parameters and point to the parsed method */
|
||||
Setattr(new_function,"defaultargs", n);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue