From: Luigi B. <lba...@us...> - 2004-05-17 12:49:55
|
Update of /cvsroot/swig/SWIG/Lib/perl5 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14131/Lib/perl5 Modified Files: std_string.i Log Message: Enable Perl automatic stringification (see 2004/05/13 post from J.Slade) Index: std_string.i =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/perl5/std_string.i,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** std_string.i 30 Nov 2002 22:01:01 -0000 1.2 --- std_string.i 17 May 2004 12:49:42 -0000 1.3 *************** *** 29,50 **** %typemap(in) string { ! if (!SvPOK((SV*) $input)) { ! SWIG_croak("Type error in argument $argnum of $symname. " ! "Expected a string"); } else { - STRLEN len; - const char *ptr = SvPV($input, len); $1.assign(ptr, len); ! } } %typemap(in) string *INPUT(std::string temp), const string & (std::string temp) { ! if (!SvPOK((SV*) $input)) { ! SWIG_croak("Type error in argument $argnum of $symname. " ! "Expected a string"); } else { - STRLEN len; - const char *ptr = SvPV($input, len); temp.assign(ptr, len); $1 = &temp; --- 29,48 ---- %typemap(in) string { ! STRLEN len; ! const char *ptr = SvPV($input, len); ! if (!ptr) { ! SWIG_croak("Undefined variable in argument $argnum of $symname."); } else { $1.assign(ptr, len); ! } } %typemap(in) string *INPUT(std::string temp), const string & (std::string temp) { ! STRLEN len; ! const char *ptr = SvPV($input, len); ! if (!ptr) { ! SWIG_croak("Undefined variable in argument $argnum of $symname."); } else { temp.assign(ptr, len); $1 = &temp; |