diff options
author | Karl Williamson <khw@cpan.org> | 2019-10-05 21:36:27 -0600 |
---|---|---|
committer | Nicolas R <atoomic@cpan.org> | 2019-11-08 12:01:12 -0700 |
commit | a1d467bc1f6f2ebac22e599b57d63891c15e3b7f (patch) | |
tree | def3581086d8ea0213a2e4649c1a9cc75d311505 /dist/Devel-PPPort/parts/inc/misc | |
parent | a807d978584f00990421a1becbe8aedb5d1ff748 (diff) | |
download | perl-a1d467bc1f6f2ebac22e599b57d63891c15e3b7f.tar.gz |
parts/inc/misc: Add withinCOUNT and inRANGE
These are too new to be in the public API, but their presence here helps
with backporting things, so provide them, but undocumented.
(cherry picked from commit eb85beedef0dfeca24cb5a011f17a893525cb098)
Signed-off-by: Nicolas R <atoomic@cpan.org>
Diffstat (limited to 'dist/Devel-PPPort/parts/inc/misc')
-rw-r--r-- | dist/Devel-PPPort/parts/inc/misc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/dist/Devel-PPPort/parts/inc/misc b/dist/Devel-PPPort/parts/inc/misc index a58e8252eb..2bf73d88ea 100644 --- a/dist/Devel-PPPort/parts/inc/misc +++ b/dist/Devel-PPPort/parts/inc/misc @@ -50,6 +50,15 @@ __UNDEFINED__ __ASSERT_(statement) assert(statement), __UNDEFINED__ __ASSERT_(statement) #endif +/* These could become provided when they become part of the public API */ +__UNDEF_NOT_PROVIDED__ withinCOUNT(c, l, n) \ + (((WIDEST_UTYPE) (((c)) - ((l) | 0))) <= (((WIDEST_UTYPE) ((n) | 0)))) +__UNDEF_NOT_PROVIDED__ inRANGE(c, l, u) \ + ( (sizeof(c) == sizeof(U8)) ? withinCOUNT(((U8) (c)), (l), ((u) - (l))) \ + : (sizeof(c) == sizeof(U16)) ? withinCOUNT(((U16) (c)), (l), ((u) - (l))) \ + : (sizeof(c) == sizeof(U32)) ? withinCOUNT(((U32) (c)), (l), ((u) - (l))) \ + : (withinCOUNT(((WIDEST_UTYPE) (c)), (l), ((u) - (l))))) + __UNDEFINED__ SvRX(rv) (SvROK((rv)) ? (SvMAGICAL(SvRV((rv))) ? (mg_find(SvRV((rv)), PERL_MAGIC_qr) ? mg_find(SvRV((rv)), PERL_MAGIC_qr)->mg_obj : NULL) : NULL) : NULL) __UNDEFINED__ SvRXOK(sv) (!!SvRX(sv)) |