Add some missing SWIGINTERN usage

This commit is contained in:
William S Fulton 2017-01-17 19:58:31 +00:00
commit d9db3cf628
6 changed files with 21 additions and 11 deletions

View file

@ -10,14 +10,17 @@
%fragment("<string>");
%{
SWIGINTERN
double SwigSvToNumber(SV* sv) {
return SvIOK(sv) ? double(SvIVX(sv)) : SvNVX(sv);
}
SWIGINTERN
std::string SwigSvToString(SV* sv) {
STRLEN len;
char *ptr = SvPV(sv, len);
return std::string(ptr, len);
}
SWIGINTERN
void SwigSvFromString(SV* sv, const std::string& s) {
sv_setpvn(sv,s.data(),s.size());
}