We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have perl somewhat like:
my $errObj = new mapscript::errorObj(); print $errObj->{message};
swig generates mapscript_wrap.c, generates this function: XS(_wrap_errorObj_message_get) { .... snip. .. arg1 = (errorObj *)(argp1); result = (char *)(char *) ((arg1)->message); { size_t size = 2048; while (size && (result[size - 1] == '\0')) --size; ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ; } ... snip ...
This treats char[] as array, not as char*, and the perl code prints the error message and then lots of garbage.
I added this code to plmodule.i:
%typemap(out) char[ANY] { $result = newSVpvn($1, strlen($1)); argvi++; }
and it SEEMS to fix the problem. I'm new to swig and mapserver, so its just a guess. But its running, in production, right now.
The text was updated successfully, but these errors were encountered:
Fixed in master branch. Closing... Steve
Sorry, something went wrong.
Simple typemap added for perl, see ticket #4305.
eaa60fa
sdlime
No branches or pull requests
I have perl somewhat like:
my $errObj = new mapscript::errorObj();
print $errObj->{message};
swig generates mapscript_wrap.c, generates this function:
XS(_wrap_errorObj_message_get) {
.... snip. ..
arg1 = (errorObj *)(argp1);
result = (char *)(char *) ((arg1)->message);
{
size_t size = 2048;
while (size && (result[size - 1] == '\0')) --size;
ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
}
... snip ...
This treats char[] as array, not as char*, and the perl code prints the error message and then lots of garbage.
I added this code to plmodule.i:
%typemap(out) char[ANY] {
$result = newSVpvn($1, strlen($1));
argvi++;
}
and it SEEMS to fix the problem. I'm new to swig and mapserver, so its just a guess. But its running, in production, right now.
The text was updated successfully, but these errors were encountered: