From: Nicholas Clark Date: Tue, 13 Oct 2009 10:05:49 +0000 (+0100) Subject: Replace Perl_deprecate() with a macro that calls Perl_ck_warner() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2acdbac104deb9113282247f3dbee83c4705a525;p=p5sagit%2Fp5-mst-13.2.git Replace Perl_deprecate() with a macro that calls Perl_ck_warner() Perl_deprecate was not part of the public API, and did not have a deprecate() shortcut macro defined without -DPERL_CORE. Neither codesearch.google.com nor CPAN::Unpack show any users outside the core. --- diff --git a/embed.fnc b/embed.fnc index 06927a8..ef0692d 100644 --- a/embed.fnc +++ b/embed.fnc @@ -213,8 +213,6 @@ Anp |char* |delimcpy |NN char* to|NN const char* toend|NN const char* from \ |NN const char* fromend|int delim|NN I32* retlen : Used in op.c, perl.c pM |void |delete_eval_scope -: Used in various files -p |void |deprecate |NN const char *const s Afp |OP* |die |NULLOK const char* pat|... #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT) s |OP* |vdie |NULLOK const char* pat|NULLOK va_list* args diff --git a/embed.h b/embed.h index 98215c2..fa90193 100644 --- a/embed.h +++ b/embed.h @@ -150,7 +150,6 @@ #define delimcpy Perl_delimcpy #ifdef PERL_CORE #define delete_eval_scope Perl_delete_eval_scope -#define deprecate Perl_deprecate #endif #define die Perl_die #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT) @@ -2489,7 +2488,6 @@ #define delimcpy Perl_delimcpy #ifdef PERL_CORE #define delete_eval_scope() Perl_delete_eval_scope(aTHX) -#define deprecate(a) Perl_deprecate(aTHX_ a) #endif #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT) #ifdef PERL_CORE diff --git a/handy.h b/handy.h index bd58bfe..6c049cb 100644 --- a/handy.h +++ b/handy.h @@ -902,6 +902,13 @@ void Perl_mem_log_del_sv(const SV *sv, const char *filename, const int linenumbe #define pTHX__VALUE #endif /* USE_ITHREADS */ +/* Perl_deprecate was not part of the public API, and did not have a deprecate() + shortcut macro defined without -DPERL_CORE. Neither codesearch.google.com nor + CPAN::Unpack show any users outside the core. */ +#ifdef PERL_CORE +# define deprecate(s) Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED), "Use of " s " is deprecated") +#endif + /* * Local variables: * c-indentation-style: bsd diff --git a/proto.h b/proto.h index ae13a6f..28923d0 100644 --- a/proto.h +++ b/proto.h @@ -516,11 +516,6 @@ PERL_CALLCONV char* Perl_delimcpy(char* to, const char* toend, const char* from, assert(to); assert(toend); assert(from); assert(fromend); assert(retlen) PERL_CALLCONV void Perl_delete_eval_scope(pTHX); -PERL_CALLCONV void Perl_deprecate(pTHX_ const char *const s) - __attribute__nonnull__(pTHX_1); -#define PERL_ARGS_ASSERT_DEPRECATE \ - assert(s) - PERL_CALLCONV OP* Perl_die(pTHX_ const char* pat, ...) __attribute__format__null_ok__(__printf__,pTHX_1,pTHX_2); diff --git a/toke.c b/toke.c index dc87f27..0b4ff5c 100644 --- a/toke.c +++ b/toke.c @@ -591,18 +591,6 @@ S_feature_is_enabled(pTHX_ const char *const name, STRLEN namelen) } /* - * Perl_deprecate - */ - -void -Perl_deprecate(pTHX_ const char *const s) -{ - PERL_ARGS_ASSERT_DEPRECATE; - - Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED), "Use of %s is deprecated", s); -} - -/* * experimental text filters for win32 carriage-returns, utf16-to-utf8 and * utf16-to-utf8-reversed. */