In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/a8a2ceaa337ed7cb30711de145f484033c43b07d?hp=cdd06489088cf64a0e621b79cdf0c48eb55f2622>
- Log ----------------------------------------------------------------- commit a8a2ceaa337ed7cb30711de145f484033c43b07d Author: Karl Williamson <[email protected]> Date: Sat Dec 29 20:18:09 2012 -0700 Create deprecated fncs to replace to-be-removed macros These macros should not be used as they are prone to misuse. There are no occurrences of them in CPAN. The single use of either of them in core has recently been removed (commit 8d40577bdbdfa85ed3293f84bf26a313b1b92f55), because it was a misuse. Instead code should use isIDFIRST_lazy_if or isWORDCHAR_lazy_if (isALNUM_lazy_if is also available, but can be confused with the Posix alnum, which it doesn't mean). M embed.fnc M embed.h M inline.h M proto.h M utf8.h commit 9bbccbfa57430eb02f257b85ecb1e158c107027e Author: Karl Williamson <[email protected]> Date: Sat Dec 29 22:02:49 2012 -0700 porting/args_assert.t: Needs to look in inline.h too inline.h is a special header file that contains C functions, and hence perhaps PERL_ARGS_ASSERTS. M t/porting/args_assert.t ----------------------------------------------------------------------- Summary of changes: embed.fnc | 2 ++ embed.h | 2 ++ inline.h | 21 +++++++++++++++++++++ proto.h | 16 ++++++++++++++++ t/porting/args_assert.t | 2 ++ utf8.h | 3 --- 6 files changed, 43 insertions(+), 3 deletions(-) diff --git a/embed.fnc b/embed.fnc index 5cff051..ccfc38a 100644 --- a/embed.fnc +++ b/embed.fnc @@ -623,6 +623,8 @@ ADMpPR |bool |is_uni_punct |UV c ADMpPR |bool |is_uni_xdigit |UV c AMp |UV |to_uni_upper |UV c|NN U8 *p|NN STRLEN *lenp AMp |UV |to_uni_title |UV c|NN U8 *p|NN STRLEN *lenp +iDMpPR |bool |isIDFIRST_lazy |NN const char* p +iDMpPR |bool |isALNUM_lazy |NN const char* p #ifdef PERL_IN_UTF8_C sR |U8 |to_lower_latin1|const U8 c|NULLOK U8 *p|NULLOK STRLEN *lenp #endif diff --git a/embed.h b/embed.h index 8fac66f..8289cec 100644 --- a/embed.h +++ b/embed.h @@ -1108,6 +1108,8 @@ #define intro_my() Perl_intro_my(aTHX) #define invert(a) Perl_invert(aTHX_ a) #define io_close(a,b) Perl_io_close(aTHX_ a,b) +#define isALNUM_lazy(a) S_isALNUM_lazy(aTHX_ a) +#define isIDFIRST_lazy(a) S_isIDFIRST_lazy(aTHX_ a) #define jmaybe(a) Perl_jmaybe(aTHX_ a) #define keyword(a,b,c) Perl_keyword(aTHX_ a,b,c) #define list(a) Perl_list(aTHX_ a) diff --git a/inline.h b/inline.h index b321cc2..85bdc74 100644 --- a/inline.h +++ b/inline.h @@ -138,3 +138,24 @@ S_croak_memory_wrap(void) #ifdef __clang__ #pragma clang diagnostic pop #endif + +/* ------------------------------- utf8.h ------------------------------- */ + +/* These exist only to replace the macros they formerly were so that their use + * can be deprecated */ + +PERL_STATIC_INLINE bool +S_isIDFIRST_lazy(pTHX_ const char* p) +{ + PERL_ARGS_ASSERT_ISIDFIRST_LAZY; + + return isIDFIRST_lazy_if(p,1); +} + +PERL_STATIC_INLINE bool +S_isALNUM_lazy(pTHX_ const char* p) +{ + PERL_ARGS_ASSERT_ISALNUM_LAZY; + + return isALNUM_lazy_if(p,1); +} diff --git a/proto.h b/proto.h index c9c667f..b4d81d6 100644 --- a/proto.h +++ b/proto.h @@ -1692,6 +1692,22 @@ PERL_CALLCONV bool Perl_io_close(pTHX_ IO* io, bool not_implicit) #define PERL_ARGS_ASSERT_IO_CLOSE \ assert(io) +PERL_STATIC_INLINE bool S_isALNUM_lazy(pTHX_ const char* p) + __attribute__deprecated__ + __attribute__warn_unused_result__ + __attribute__pure__ + __attribute__nonnull__(pTHX_1); +#define PERL_ARGS_ASSERT_ISALNUM_LAZY \ + assert(p) + +PERL_STATIC_INLINE bool S_isIDFIRST_lazy(pTHX_ const char* p) + __attribute__deprecated__ + __attribute__warn_unused_result__ + __attribute__pure__ + __attribute__nonnull__(pTHX_1); +#define PERL_ARGS_ASSERT_ISIDFIRST_LAZY \ + assert(p) + PERL_CALLCONV bool Perl_is_ascii_string(const U8 *s, STRLEN len) __attribute__nonnull__(1); #define PERL_ARGS_ASSERT_IS_ASCII_STRING \ diff --git a/t/porting/args_assert.t b/t/porting/args_assert.t index e1a2fa5..27e9bf2 100644 --- a/t/porting/args_assert.t +++ b/t/porting/args_assert.t @@ -39,6 +39,8 @@ if (!@ARGV) { # *.c or */*.c push @ARGV, $prefix . $1 if m!^((?:[^/]+/)?[^/]+\.c)\t!; } + push @ARGV, $prefix . 'inline.h'; # Special case this '.h' which acts like + # a '.c' } while (<>) { diff --git a/utf8.h b/utf8.h index bc9470d..ddcd73b 100644 --- a/utf8.h +++ b/utf8.h @@ -298,9 +298,6 @@ Perl's extended UTF-8 means we can have start bytes up to FF. : isWORDCHAR_utf8((const U8*)p)) #define isALNUM_lazy_if(p,UTF) isWORDCHAR_lazy_if(p,UTF) -#define isIDFIRST_lazy(p) isIDFIRST_lazy_if(p,1) -#define isALNUM_lazy(p) isALNUM_lazy_if(p,1) - #define UTF8_MAXLEN UTF8_MAXBYTES /* A Unicode character can fold to up to 3 characters */ -- Perl5 Master Repository
