diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-12-22 16:33:01 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-12-24 09:25:15 -0800 |
commit | 03222170f0449b3f2e9185ef2ef65ad58f54c2f5 (patch) | |
tree | 79e0419b59d8ad300af9d0ba78ddec2443aebef2 /feature.h | |
parent | 40e4d872ac5e7318bdf400a3bdf5a89c482c2003 (diff) | |
download | perl-03222170f0449b3f2e9185ef2ef65ad58f54c2f5.tar.gz |
Add macros for checking individual features
Diffstat (limited to 'feature.h')
-rw-r--r-- | feature.h | 62 |
1 files changed, 62 insertions, 0 deletions
@@ -19,6 +19,68 @@ (PL_curcop == &PL_compiling ? PL_hints : PL_curcop->cop_hints) #define CURRENT_FEATURE_BUNDLE (CURRENT_HINTS >> HINT_FEATURE_SHIFT) +#define FEATURE_SAY_IS_ENABLED \ + ( \ + (CURRENT_FEATURE_BUNDLE >= FEATURE_BUNDLE_510 && \ + CURRENT_FEATURE_BUNDLE <= FEATURE_BUNDLE_515) \ + || (CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \ + FEATURE_IS_ENABLED("say")) \ + ) + +#define FEATURE_STATE_IS_ENABLED \ + ( \ + (CURRENT_FEATURE_BUNDLE >= FEATURE_BUNDLE_510 && \ + CURRENT_FEATURE_BUNDLE <= FEATURE_BUNDLE_515) \ + || (CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \ + FEATURE_IS_ENABLED("state")) \ + ) + +#define FEATURE_SWITCH_IS_ENABLED \ + ( \ + (CURRENT_FEATURE_BUNDLE >= FEATURE_BUNDLE_510 && \ + CURRENT_FEATURE_BUNDLE <= FEATURE_BUNDLE_515) \ + || (CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \ + FEATURE_IS_ENABLED("switch")) \ + ) + +#define FEATURE_EVALBYTES_IS_ENABLED \ + ( \ + CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_515 \ + || (CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \ + FEATURE_IS_ENABLED("evalbytes")) \ + ) + +#define FEATURE_ARYBASE_IS_ENABLED \ + ( \ + (CURRENT_FEATURE_BUNDLE >= FEATURE_BUNDLE_DEFAULT && \ + CURRENT_FEATURE_BUNDLE <= FEATURE_BUNDLE_511) \ + || (CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \ + FEATURE_IS_ENABLED_d("arybase")) \ + ) + +#define FEATURE___SUB___IS_ENABLED \ + ( \ + CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_515 \ + || (CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \ + FEATURE_IS_ENABLED("__SUB__")) \ + ) + +#define FEATURE_UNIEVAL_IS_ENABLED \ + ( \ + CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_515 \ + || (CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \ + FEATURE_IS_ENABLED("unieval")) \ + ) + +#define FEATURE_UNICODE_IS_ENABLED \ + ( \ + (CURRENT_FEATURE_BUNDLE >= FEATURE_BUNDLE_511 && \ + CURRENT_FEATURE_BUNDLE <= FEATURE_BUNDLE_515) \ + || (CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \ + FEATURE_IS_ENABLED("unicode")) \ + ) + + #endif /* PERL_CORE or PERL_EXT */ /* ex: set ro: */ |