This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Only prototype should_warn_nl under PERL_CORE.
authorCraig A. Berry <craigberry@mac.com>
Thu, 29 May 2014 22:08:37 +0000 (17:08 -0500)
committerCraig A. Berry <craigberry@mac.com>
Thu, 29 May 2014 22:13:09 +0000 (17:13 -0500)
Otherwise the prototype is seen in places where the function
itself is not defined, which is illegal for inline functions.

Follow-up to 7cb3f9598b37fc.

embed.fnc
embed.h
proto.h

index fc3ed95..6853ebc 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1643,7 +1643,9 @@ Ap     |I32    |whichsig_pv    |NN const char* sig
 Ap     |I32    |whichsig_pvn   |NN const char* sig|STRLEN len
 : used to check for NULs in pathnames and other names
 AiR    |bool   |is_safe_syscall|NN const char *pv|STRLEN len|NN const char *what|NN const char *op_name
+#ifdef PERL_CORE
 inR    |bool   |should_warn_nl|NN const char *pv
+#endif
 : Used in pp_ctl.c
 p      |void   |write_to_stderr|NN SV* msv
 : Used in op.c
diff --git a/embed.h b/embed.h
index b7a0290..554fea3 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define scalar(a)              Perl_scalar(aTHX_ a)
 #define scalarvoid(a)          Perl_scalarvoid(aTHX_ a)
 #define set_caret_X()          Perl_set_caret_X(aTHX)
-#define should_warn_nl         S_should_warn_nl
 #define sub_crush_depth(a)     Perl_sub_crush_depth(aTHX_ a)
 #define sv_2num(a)             Perl_sv_2num(aTHX_ a)
 #define sv_clean_all()         Perl_sv_clean_all(aTHX)
 #define opslab_free(a)         Perl_opslab_free(aTHX_ a)
 #define opslab_free_nopad(a)   Perl_opslab_free_nopad(aTHX_ a)
 #define parser_free_nexttoke_ops(a,b)  Perl_parser_free_nexttoke_ops(aTHX_ a,b)
+#define should_warn_nl         S_should_warn_nl
 #    if defined(PERL_DEBUG_READONLY_OPS)
 #define Slab_to_ro(a)          Perl_Slab_to_ro(aTHX_ a)
 #define Slab_to_rw(a)          Perl_Slab_to_rw(aTHX_ a)
diff --git a/proto.h b/proto.h
index f7716b5..140d7f3 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -3849,12 +3849,6 @@ PERL_CALLCONV HEK*       Perl_share_hek(pTHX_ const char* str, I32 len, U32 hash)
 #define PERL_ARGS_ASSERT_SHARE_HEK     \
        assert(str)
 
-PERL_STATIC_INLINE bool        S_should_warn_nl(const char *pv)
-                       __attribute__warn_unused_result__
-                       __attribute__nonnull__(1);
-#define PERL_ARGS_ASSERT_SHOULD_WARN_NL        \
-       assert(pv)
-
 PERL_CALLCONV void     Perl_sortsv(pTHX_ SV** array, size_t num_elts, SVCOMPARE_t cmp)
                        __attribute__nonnull__(pTHX_3);
 #define PERL_ARGS_ASSERT_SORTSV        \
@@ -5501,6 +5495,12 @@ PERL_CALLCONV void       Perl_parser_free_nexttoke_ops(pTHX_ yy_parser *parser, OPSLAB
 #define PERL_ARGS_ASSERT_PARSER_FREE_NEXTTOKE_OPS      \
        assert(parser); assert(slab)
 
+PERL_STATIC_INLINE bool        S_should_warn_nl(const char *pv)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(1);
+#define PERL_ARGS_ASSERT_SHOULD_WARN_NL        \
+       assert(pv)
+
 #  if defined(PERL_DEBUG_READONLY_OPS)
 PERL_CALLCONV void     Perl_Slab_to_ro(pTHX_ OPSLAB *slab)
                        __attribute__nonnull__(pTHX_1);