From: Marcelo M. <mm...@ac...> - 2006-01-14 01:27:56
|
Could you provide a small non-working example? I added what class OSRSpatialReferenceShadow { private: OSRSpatialReferenceShadow(); public: %extend { OSRSpatialReferenceShadow( char const * wkt = "" ) { ... } } to the test-suite/default_constructor.i example and it works as expected. So, there should be something else that is triggering the wrong behavior. Marcelo Charlie Savage wrote: > There seems to be a change in 1.3.28 head with default constructors. > > Here is a .i file that worked under 1.3.27: > > typedef void OSRSpatialReferenceShadow; > > class OSRSpatialReferenceShadow { > private: > OSRSpatialReferenceShadow(); > public: > %extend { > OSRSpatialReferenceShadow( char const * wkt = "" ) { > ... > } > } > > In 1.3.28 this does not work anymore because SWIG generates a default > constructor which tries to call: > > new OSRSpatialReferenceShadow(); > > Which of course doesn't work. According to the documentation, SWIG > will not generate a default constructor if a class defines a > destructor with arguments. That seems to have changed with 1.3.28. > Its easy enough to change the .i file to add a private default > constructor. However, this is a breaking change. Was it intentional? > > Charlie > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Swig-devel mailing list > Swi...@li... > https://lists.sourceforge.net/lists/listinfo/swig-devel |