Re^3: Defining an XS symbol in the Makefile.PLby syphilis (Bishop)
|on Aug 18, 2019 at 07:15 UTC||Need Help??|
Generating a header file to be included by the C/XS code seems to be the more portable approach
That's probably sort of what I'm doing - and my initial post oversimplified things.
See this Scalar-List-Utils bug report for a better picture.
The real issue is that MY_FORMAT needs to be defined to "%.17" (if NV is 64 bit), to be defined to "%.21" (if NV is 80 bit), to be defined to "%.36" (if NV is 128 bit).
It's quite easy during the Makefile.PL processing to determine which it needs to be - and surely the simplest thing to do is to just have the Makefile.PL define MY_FORMAT to the correct string.
But you're right ... and jcb's suggestion (along with several variations thereof) is not working.
At the moment, the Makefile.PL is doing:
And the XS file is rewritten to redefine the symbol to the appropriate value:
It's working fine .... but I feel that I should be able to define MY_FORMAT directly within the Makefile.PL and avoid having to add that preprocessing to the XS file ??