Content-Type: multipart/alternative; boundary="----_=_NextPart_002_01C94A96.ECF18F59" ------_=_NextPart_002_01C94A96.ECF18F59 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I sent this same report to the users list and waited a week but it didn't seem to attract any attention. Since then I have verified that it doesn't happen in version 1.3.35 on ubuntu so that leads me to believe that it was an error introduced between 35 and 36 but I have so far been able to figure out where in the code to look for a change between the 2 versions that could cause this, if anyone can point me in the correct direction I would appreciate it.=20 =20 Thanks Sam Hendley =20 From: Sam Hendley=20 Sent: Wednesday, November 12, 2008 11:29 AM To: 'swig-user@lists.sourceforge.net' Subject: Bug with version 1.3.36 Ruby directors module (possibly before) =20 Hello all, first off let me say I love SWIG, it has made my current project both possible and fun. We have been able to create bindings to our "core" code to ruby and therefore have been able to work much faster and more efficiently on the higher level logic. I built all of our bindings based on SWIG 1.3.29 (which is what cygwin had as the current package when I started work on it). Everything works well with that version, when I updated to 1.3.36 on cygwin (and I think 1.3.33 on Ubunutu) the build started failing. For some reason the newest version of the code is defining the functions twice. I have narrowed it down to being a problem with the "directors" module and having overloaded functions. =20 I have a very simple test case attached that demonstrates my issue. Here are my results running version 1.3.36 on cygwin: =20 swig -c++ -ruby -o Interfaces_wrap.cpp Interfaces.i ; g++ Interfaces_wrap.cpp -I RUBY_LIB * Non overloaded function with directors everything works! =20 swig -c++ -DTYPE2 -ruby -o Interfaces_wrap.cpp Interfaces.i ; g++ -DTYPE2 Interfaces_wrap.cpp -I RUBY_LIB * Overloaded function with directors, failure with multiply defined _Update function ############## From Interfaces_wrap.cpp (Notice 2 protected method definitions) ########### cIDataObserver.klass =3D rb_define_class_under(mDnpstack, = "IDataObserver", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_psi__IDataObserver, (void *) &cIDataObserver); rb_define_alloc_func(cIDataObserver.klass, _wrap_IDataObserver_allocate); rb_define_method(cIDataObserver.klass, "initialize", VALUEFUNC(_wrap_new_IDataObserver), -1); rb_define_protected_method(cIDataObserver.klass, "_Update", VALUEFUNC(_wrap_IDataObserver__Update), -1); rb_define_protected_method(cIDataObserver.klass, "_Update", VALUEFUNC(_wrap_IDataObserver__Update), -1); =20 swig -c++ -DTYPE2 -ruby -o Interfaces_wrap.cpp Interfaces_nodirectors.i ; g++ -DTYPE2 Interfaces_wrap.cpp -I RUBY_LIB * Builds correctly without directors enabled =20 swig -c++ -ruby -o Interfaces_wrap.cpp Interfaces_nodirectors.i ; g++ Interfaces_wrap.cpp -I RUBY_LIB * Builds correctly without directors and without overloaded function =20 I started looking at the SWIG codebase but it's a bit overwhelming so I am hoping this issue can be looked at by someone closer to code (and specifically the changes introduced since 1.3.29 when I know it was working correctly). I think this case is simple enough that this could be used as a unit test. If someone knows enough about where to start looking but not enough time to work the issue let me know where to look and I will poke around the code base to see if I can fix the issue myself. =20 If anyone read this far, thanks for taking an interest! =20 Sam Hendley ------_=_NextPart_002_01C94A96.ECF18F59 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I sent this same = report to the users list and waited a week but it didn’t seem to attract any = attention. Since then I have verified that it doesn’t happen in version = 1.3.35 on ubuntu so that leads me to believe that it was an error introduced = between 35 and 36 but I have so far been able to figure out where in the code to = look for a change between the 2 versions that could cause this, if anyone can = point me in the correct direction I would appreciate it.

 

Thanks

Sam = Hendley

 

From:= Sam = Hendley
Sent: Wednesday, November 12, 2008 11:29 AM
To: 'swig-user@lists.sourceforge.net'
Subject: Bug with version 1.3.36 Ruby directors module (possibly = before)

 

Hello all, first off let me say I love SWIG, it has = made my current project both possible and fun. We have been able to create = bindings to our “core” code to ruby and therefore have been able to work = much faster and more efficiently on the higher level logic. I built all of = our bindings based on SWIG 1.3.29 (which is what cygwin had as the current = package when I started work on it). Everything works well with that version, = when I updated to 1.3.36 on cygwin (and I think 1.3.33 on Ubunutu) the build = started failing. For some reason the newest version of the code is defining the functions twice. I have narrowed it down to being a problem with the “directors” module and having overloaded = functions.

 

I have a very simple test case attached that = demonstrates my issue. Here are my results  running version 1.3.36 on = cygwin:

 

swig -c++ -ruby -o Interfaces_wrap.cpp Interfaces.i = ; g++ Interfaces_wrap.cpp -I RUBY_LIB

·         Non overloaded function with directors everything works!

 

swig -c++ -DTYPE2 -ruby -o Interfaces_wrap.cpp = Interfaces.i ; g++ -DTYPE2 Interfaces_wrap.cpp -I RUBY_LIB

·         Overloaded function with directors, = failure with multiply defined _Update function

############## From Interfaces_wrap.cpp (Notice 2 = protected method definitions) ###########

cIDataObserver.klass =3D = rb_define_class_under(mDnpstack, "IDataObserver", rb_cObject);

SWIG_TypeClientData(SWIGTYPE_p_psi__IDataObserver, = (void *) &cIDataObserver);

rb_define_alloc_func(cIDataObserver.klass, _wrap_IDataObserver_allocate);

rb_define_method(cIDataObserver.klass, "initialize", VALUEFUNC(_wrap_new_IDataObserver), = -1);

rb_define_protected_method(cIDataObserver.klass, "_Update", VALUEFUNC(_wrap_IDataObserver__Update), = -1);

rb_define_protected_method(cIDataObserver.klass, "_Update", VALUEFUNC(_wrap_IDataObserver__Update), = -1);

 

swig -c++ -DTYPE2 -ruby -o Interfaces_wrap.cpp Interfaces_nodirectors.i ; g++ -DTYPE2 Interfaces_wrap.cpp -I = RUBY_LIB

·         Builds correctly without directors = enabled

 

swig -c++ -ruby -o Interfaces_wrap.cpp Interfaces_nodirectors.i ; g++ Interfaces_wrap.cpp -I = RUBY_LIB

·         Builds correctly without directors and = without overloaded function

 

I started looking at the SWIG codebase but = it’s a bit overwhelming so I am hoping this issue can be looked at by someone = closer to code (and specifically the changes introduced since 1.3.29 when I know = it was working correctly). I think this case is simple enough that this could = be used as a unit test. If someone knows enough about where to start looking but = not enough time to work the issue let me know where to look and I will poke = around the code base to see if I can fix the issue myself.

 

If anyone read this far, thanks for taking an = interest!

 

Sam Hendley

------_=_NextPart_002_01C94A96.ECF18F59--