develooper Front page | perl.perl5.porters | Postings from July 2019

#define PERL_EXT to get feature test macros

Thread Next
From:
Paul "LeoNerd" Evans
Date:
July 22, 2019 19:34
Subject:
#define PERL_EXT to get feature test macros
Message ID:
20190722203425.696fef53@shy.leonerd.org.uk
There's some handy macros in feature.h that define useful tests like

    if (!FEATURE_SIGNATURES_IS_ENABLED)
        Perl_croak(aTHX_ "Experimental subroutine signatures not enabled");

If I do something like this then I can use them in an XS module:

  #define PERL_EXT
  #include "feature.h"

Is that a good idea? If not, could it become one somehow? It'd be
useful to have a nice way for XS modules (especially those implementing
syntax features) to easily query such state. Without this I'd have to
do quite a bit of copy-pasting from internals to get the same effect.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About