Hi,
(This is one of those types of posts that I don't like to read ... and like even less to write. Apologies in advance.)
The C library in question is gsl-1.11 (which is the latest release of that library, iinm).
The function in question is
gsl_set_error_handling_off - which, when called, is supposed to disable inbuilt error handling in certain specific functions within the gsl-1.11 C library.
I have no problem in using that function in my C programs.
In Inline::C I've wrapped that function as:
void wrap_error_handler_off() {
gsl_set_error_handler_off();
}
And that works fine - calling
wrap_error_handler_off() does what it is supposed to do. That is, having called
wrap_error_handler_off(), when I subsequently call these other "certain specific functions" (which have also been wrapped), I find that their inbuilt error handling has in fact been disabled as expected.
But, if I put the exact same wrapping into a module's XS file, it doesn't work ... it's not that any errors are produced (there are none) ... it's just that calling
MyMod::wrap_error_handler_off() has no effect whatsoever. One might just as well not call the function at all.
Has anyone ever seen anything like this ? I've wrapped a few C libraries in my time, and I certainly haven't.
One other aspect to this is that it seems to be a Win32-specific issue - linux, at least, is *not* subject to this strange behaviour. On linux, the disablng works fine, irrespective of whether we're calling the function in Inline::C, or from within some particular namespace (module/extension).
The latest Math::GSL test suite relies on the functionality of the wrapping of
gsl_set_error_handler_off. That test suite runs fine on linux. On win32 there are failures because of this very problem.
Any inkling as to what might be happening (and what to do about it) would be most enlightening.
Cheers,
Rob
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.