Menu

#1203 operator->() handling and custom properties using %extend

open
lua (25)
5
2022-02-18
2011-11-02
ice wind
No

swig.exe -c++ -v -lua -Fmicrosoft -o bind.cpp testClass.i

Discussion

  • ice wind

    ice wind - 2011-11-02
     
  • ice wind

    ice wind - 2011-11-02
     
  • ice wind

    ice wind - 2011-11-02

    Binder asks for specific get/set implementation for SharedPtr<TestClass> and SharedPtr<Derrived>
    Error output:
    1>c:\dev\projects\tiga2d\console\bind.cpp(1938): error C3861: 'SharedPtr_Sl_TestClass_Sg__value_set': identifier not found
    1>c:\dev\projects\tiga2d\console\bind.cpp(1962): error C3861: 'SharedPtr_Sl_TestClass_Sg__value_get': identifier not found
    1>c:\dev\projects\tiga2d\console\bind.cpp(2158): error C3861: 'SharedPtr_Sl_Derived_Sg__value_set': identifier not found
    1>c:\dev\projects\tiga2d\console\bind.cpp(2182): error C3861: 'SharedPtr_Sl_Derived_Sg__value_get': identifier not found

    Though TestClass_value_get and TestClass_value_set could be used instead

     
  • ice wind

    ice wind - 2011-11-02

    resolved by myself
    modified method Allocate::smart_pointer_methods, line 434, added
    Setattr(cp, "origin", Getattr(cls, "name") );
    and used this attribute to resolve original property getter/setter name in functions Swig_MembersetToFunction and Swig_MembergetToFunction

     
  • Olly Betts

    Olly Betts - 2011-11-28

    Which version of SWIG are you using and line 434 of which source file?

     
  • ice wind

    ice wind - 2011-11-29

    SVN revision 12829

    /Source/Modules/allocate.cxx 434, Allocate::smart_pointer_methods implementation
    /Source/Swig/cwrap.c, Swig_MembersetToFunction and Swig_MembergetToFunction implementations

     
  • Olly Betts

    Olly Betts - 2022-02-18

    The testcase provided is incomplete (several headers are missing) so it's hard to confirm, but I don't see any obvious sign of changes like those suggested having been made. This might have been fixed by changes elsewhere though.

     

Log in to post a comment.