Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^6: Inline::C and NULL pointers

by syphilis (Archbishop)
on Dec 20, 2021 at 03:19 UTC ( [id://11139757]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Inline::C and NULL pointers
in thread Inline::C and NULL pointers

(e.g. on CPAN, it's 3.35 from Jul 2017; in Perl it's 3.44)

Yes, I've seen your latest post to #16916. Good luck with that.
A few days ago, on the porters list, someone volunteered to address that very issue.
In the past, I've experienced similar frustration in the other direction - ie trying to get perl updated to the latest version on CPAN.
These dual-life modules are a wonderful idea ... until they're not.

Have you tried putting a new T_PTR definition in your own typemap?

I don't see any point in that wrt the issue of getting undef passed from perl into C space as a NULL.
The issue is that unsigned char* is presently being typemapped to T_PV in lib/ExtUtils/typemap.
AFAIK, there's no need to alter the current T_PTR definition; it's just a matter of getting the unsigned char * typemapped to T_PTR. (And that's precisely what happens in my little custom typemap that Inline::C finds.

I did first try editing ExtUtils/typemap so that unsigned char* is typed to T_PTR, and that had the desired effect of passing undef as NULL, and without any need for a custom typemap.
But I don't think it's a good idea to be modifying CORE files.

Cheers,
Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11139757]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-20 01:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found