On 24/05/12 19:45, Alexey Sokolov wrote:
Hello!

At ZNC we have an own string class CString, which is inherited from
std::string.
The goal is to use it as a just string in target languages.

How to do that properly?

When I was writing modperl and modpython ZNC modules, I used an approach
described at
http://old.nabble.com/Forward-declaration-error--td24064356.html
Used "swig -E" on std_string.i, got a long file as a result, cleaned it
up and changed all occurences of std::string to CString.
It worked fine before SWIG 2.0.5, but in 2.0.5 it started to give errors
while generating sources for modpython:

/usr/share/swig/2.0.6/std/std_pair.i:31: Error: Can't copy typemap
(directorout) std::pair<  CString,CString>  = std::pair<  CString,CString
> &DIRECTOROUT
/usr/share/swig/2.0.6/std/std_pair.i:31: Error: Can't copy typemap (in)
std::pair< CString,CString> *INPUT = std::pair< CString,CString> *INOUT
/usr/share/swig/2.0.6/std/std_pair.i:31: Error: Can't copy typemap (in)
std::pair< CString,CString> &INPUT = std::pair< CString,CString> &INOUT
/usr/share/swig/2.0.6/std/std_pair.i:31: Error: Can't copy typemap
(typecheck) std::pair<  CString,CString>  *INPUT = std::pair<
CString,CString>  *INOUT
/usr/share/swig/2.0.6/std/std_pair.i:31: Error: Can't copy typemap
(typecheck) std::pair<  CString,CString>  &INPUT = std::pair<
CString,CString>  &INOUT
/usr/share/swig/2.0.6/std/std_pair.i:31: Error: Can't copy typemap
(argout) std::pair<  CString,CString>  *OUTPUT = std::pair<
CString,CString>  *INOUT
/usr/share/swig/2.0.6/std/std_pair.i:31: Error: Can't copy typemap
(argout) std::pair<  CString,CString>  &OUTPUT = std::pair<
CString,CString>  &INOUT
/usr/share/swig/2.0.6/std/std_pair.i:31: Error: Can't copy typemap
(typecheck) std::pair<  CString,CString>  *INPUT = std::pair<
CString,CString>  *INOUT
/usr/share/swig/2.0.6/std/std_pair.i:31: Error: Can't copy typemap
(typecheck) std::pair<  CString,CString>  &INPUT = std::pair<
CString,CString>  &INOUT
/usr/share/swig/2.0.6/std/std_pair.i:31: Error: Can't copy typemap
(freearg) std::pair<  CString,CString>  *INPUT = std::pair<
CString,CString>  *INOUT
/usr/share/swig/2.0.6/std/std_pair.i:31: Error: Can't copy typemap
(freearg) std::pair<  CString,CString>  &INPUT = std::pair<
CString,CString>  &INOUT

Sending copy of the letter to 672...@bugs.debian.org
Also there is related issue #174 on github/znc.
I can't replicate this bug with 2.0.6, you are going to have to provide a test case. swig-2.0.5 introduced a regression which was fixed in 2.0.7 - incorrect typemaps for templates were being used in conjunction with typedef. Please try 2.0.7 and report back if fixed.

William



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to