diff options
author | Karl Williamson <khw@cpan.org> | 2022-02-17 20:00:15 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-05-31 06:52:33 -0600 |
commit | ff00d73bbce9a135c78de0d69548d7fad0dd02ad (patch) | |
tree | 2b6e600dca53a6518eaf8fb4290f1b0053742f88 /handy.h | |
parent | 8fcaedaae577eaca064a33debe61acb344a48a33 (diff) | |
download | perl-ff00d73bbce9a135c78de0d69548d7fad0dd02ad.tar.gz |
Make STRLENs() available to core
This may cause problems when not used correctly; so continue to restrict
it.
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2827,6 +2827,12 @@ last-inclusive range. #define C_ARRAY_LENGTH(a) (sizeof(a)/sizeof((a)[0])) #define C_ARRAY_END(a) ((a) + C_ARRAY_LENGTH(a)) +#if defined(PERL_CORE) || defined(PERL_EXT_RE_BUILD) +/* strlen() of a literal string constant. Restricting this to core, in part + * because it can generate compiler warnings about comparing unlike signs */ +# define STRLENs(s) (sizeof("" s "") - 1) +#endif + #ifdef NEED_VA_COPY # ifdef va_copy # define Perl_va_copy(s, d) va_copy(d, s) |