From: <rm...@mh...> - 2004-01-23 14:58:20
|
On Fri, Jan 23, 2004 at 03:47:10PM +0100, Matthias Koeppe wrote: > > I don't have the C or C++ spec here, but I doubt that this is a valid > declaration. At least, both GCC 2.95.2 and the Sun Forte 6u2 C and > C++ compilers report an error here. (Of course, I tested it with an > ordinary function, not a method.) G++ 2.95.2, however, accepts this, > but I don't think this means anything. Yes, i'll go back to the specs ASAP. It turns out that the problems i encountered in Xapian where caused by the interface file, not the headers (i'll submit this as a bugreport to Xapian). > I admit to have written interface declarations like this in SWIG > before, though: > > void foo(int *OUTPUT, int *OUTPUT); > > This is why I will commit the following change which fixes the emitted > shadow method definition. It will show up in the next release of > SWIG. Oh, thank's a lot. I'll try it out ASAP. RalfD > --- guile.cxx.~1.11.~ Fri Nov 21 10:18:10 2003 > +++ guile.cxx Fri Jan 23 15:40:10 2004 > @@ -706,6 +706,7 @@ > String *returns = NewString(""); > String *method_signature = NewString(""); > String *primitive_args = NewString(""); > + Hash *scheme_arg_names = NewHash(); > int num_results = 1; > String *tmp = NewString(""); > String *tm; > @@ -826,10 +827,10 @@ > SwigType *pn = Getattr(p,"name"); > String *argname; > scheme_argnum++; > - if (pn) > + if (pn && !Getattr(scheme_arg_names, pn)) > argname = pn; > else { > - /* Anonymous arg -- choose a name that cannot clash */ > + /* Anonymous arg or re-used argument name -- choose a name that cannot clash */ > argname = NewStringf("%%arg%d", scheme_argnum); > } > if (strcmp("void", Char(pt)) != 0) { > @@ -841,6 +842,7 @@ > Printv(method_signature, " ", argname, NIL); > } > Printv(primitive_args, " ", argname, NIL); > + Setattr(scheme_arg_names, argname, p); > } > if (!pn) { > Delete(argname); > @@ -1184,6 +1186,7 @@ > Delete(doc_body); > Delete(returns); > Delete(tmp); > + Delete(scheme_arg_names); > DelWrapper(f); > return SWIG_OK; > } > > -- > Matthias Koeppe -- http://www.math.uni-magdeburg.de/~mkoeppe > _______________________________________________ > Swig maillist - Sw...@cs... > http://mailman.cs.uchicago.edu/mailman/listinfo/swig |