|Keep It Simple, Stupid|
Defining an XS symbol in the Makefile.PLby syphilis (Bishop)
|on Aug 18, 2019 at 04:59 UTC||Need Help??|
syphilis has asked for the wisdom of the Perl Monks concerning the following question:
In an XS file I have the following line of code:
I want to rewrite that line as:
I also wish to then define MY_FORMAT to "%.16e" in the Makefile.PL.
This is normally achieved by assigning an appropriate value to DEFINE in the WRITEMAKEFILE() section of the Makefile.PL - eg:
But that specific incantation fails to work - and I haven't been able to hit on the incantation that *does* work.
Update: By "not work", I mean that it either won't compile or it leads to runtime crashes (depending upon the actual incantation I've tried).
Any help would be much appreciated.
I've also spent a couple of hours trying to get this working in Inline::C. If I can get it to work in Inline::C, then I'll be able to use the incantation in the Makefile.PL that Inline::C generates.
Here's that Inline::C script:
I've tried various escapes around "%.16e" but nothing has been successful.
In C, it's pretty simple to achieve:
I'm not all that bothered if it turns out that Inline::C can't handle the construct, but I *would* like to know how to do it in the XS file via the Makefile.PL if, indeed, that's possible at all.