summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2012-05-06 15:09:07 -0500
committerCraig A. Berry <craigberry@mac.com>2012-05-24 08:44:13 -0500
commitf59c1a320bfb9c66aeddbef6eee71d7aaecbf890 (patch)
tree0d22379ef1e4cc895e1f4a412f6a39c2defc99ea
parentd447858807dcd6b3333ec676ebade389de5c8234 (diff)
downloadperl-f59c1a320bfb9c66aeddbef6eee71d7aaecbf890.tar.gz
The reentrant API should always have prototypes.
reentr.c always defines and exports its functions even when USE_REENTRANT_API is not defined (though they'll be empty functions in that case). In general we shouldn't be exporting functions without providing prototypes for them, but specifically, when compiling with C++, the prototype-less functions get their names mangled. So the purpose of defining the functions when we aren't using them (to have a consistent API) is defeated because no one looking for those functions under their proper names would be able to find them. So this makes us stop hiding the prototypes when USE_REENTRANT_API is not defined.
-rw-r--r--embed.fnc4
-rw-r--r--embed.h10
-rw-r--r--proto.h18
3 files changed, 14 insertions, 18 deletions
diff --git a/embed.fnc b/embed.fnc
index b675cde0a4..e18449adad 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -983,12 +983,12 @@ p |void |peep |NULLOK OP* o
p |void |rpeep |NULLOK OP* o
: Defined in doio.c, used only in pp_hot.c
dopM |PerlIO*|start_glob |NN SV *tmpglob|NN IO *io
-#if defined(USE_REENTRANT_API)
+
Ap |void |reentrant_size
Ap |void |reentrant_init
Ap |void |reentrant_free
Anp |void* |reentrant_retry|NN const char *f|...
-#endif
+
: "Very" special - can't use the O flag for this one:
: (The rename from perl_atexit to Perl_call_atexit was in 864dbfa3ca8032ef)
Ap |void |call_atexit |ATEXIT_t fn|NULLOK void *ptr
diff --git a/embed.h b/embed.h
index f5d5e5d3aa..62cd24e42b 100644
--- a/embed.h
+++ b/embed.h
@@ -437,6 +437,10 @@
#define re_compile(a,b) Perl_re_compile(aTHX_ a,b)
#define re_intuit_start(a,b,c,d,e,f) Perl_re_intuit_start(aTHX_ a,b,c,d,e,f)
#define re_intuit_string(a) Perl_re_intuit_string(aTHX_ a)
+#define reentrant_free() Perl_reentrant_free(aTHX)
+#define reentrant_init() Perl_reentrant_init(aTHX)
+#define reentrant_retry Perl_reentrant_retry
+#define reentrant_size() Perl_reentrant_size(aTHX)
#define reg_named_buff_all(a,b) Perl_reg_named_buff_all(aTHX_ a,b)
#define reg_named_buff_exists(a,b,c) Perl_reg_named_buff_exists(aTHX_ a,b,c)
#define reg_named_buff_fetch(a,b,c) Perl_reg_named_buff_fetch(aTHX_ a,b,c)
@@ -845,12 +849,6 @@
#define PerlIO_unread(a,b,c) Perl_PerlIO_unread(aTHX_ a,b,c)
#define PerlIO_write(a,b,c) Perl_PerlIO_write(aTHX_ a,b,c)
#endif
-#if defined(USE_REENTRANT_API)
-#define reentrant_free() Perl_reentrant_free(aTHX)
-#define reentrant_init() Perl_reentrant_init(aTHX)
-#define reentrant_retry Perl_reentrant_retry
-#define reentrant_size() Perl_reentrant_size(aTHX)
-#endif
#if defined(WIN32) || defined(__SYMBIAN32__) || defined(VMS)
#define do_aspawn(a,b,c) Perl_do_aspawn(aTHX_ a,b,c)
#define do_spawn(a) Perl_do_spawn(aTHX_ a)
diff --git a/proto.h b/proto.h
index 7214030667..5630f6d623 100644
--- a/proto.h
+++ b/proto.h
@@ -3158,6 +3158,14 @@ PERL_CALLCONV Malloc_t Perl_realloc(Malloc_t where, MEM_SIZE nbytes)
__attribute__malloc__
__attribute__warn_unused_result__;
+PERL_CALLCONV void Perl_reentrant_free(pTHX);
+PERL_CALLCONV void Perl_reentrant_init(pTHX);
+PERL_CALLCONV void* Perl_reentrant_retry(const char *f, ...)
+ __attribute__nonnull__(1);
+#define PERL_ARGS_ASSERT_REENTRANT_RETRY \
+ assert(f)
+
+PERL_CALLCONV void Perl_reentrant_size(pTHX);
/* PERL_CALLCONV OP* Perl_ref(pTHX_ OP* o, I32 type); */
PERL_CALLCONV HV * Perl_refcounted_he_chain_2hv(pTHX_ const struct refcounted_he *c, U32 flags);
PERL_CALLCONV SV * Perl_refcounted_he_fetch_pv(pTHX_ const struct refcounted_he *chain, const char *key, U32 hash, U32 flags)
@@ -7676,16 +7684,6 @@ PERL_CALLCONV SSize_t Perl_PerlIO_write(pTHX_ PerlIO *f, const void *vbuf, Size_
assert(vbuf)
#endif
-#if defined(USE_REENTRANT_API)
-PERL_CALLCONV void Perl_reentrant_free(pTHX);
-PERL_CALLCONV void Perl_reentrant_init(pTHX);
-PERL_CALLCONV void* Perl_reentrant_retry(const char *f, ...)
- __attribute__nonnull__(1);
-#define PERL_ARGS_ASSERT_REENTRANT_RETRY \
- assert(f)
-
-PERL_CALLCONV void Perl_reentrant_size(pTHX);
-#endif
#if defined(WIN32) || defined(__SYMBIAN32__) || defined(VMS)
PERL_CALLCONV int Perl_do_aspawn(pTHX_ SV* really, SV** mark, SV** sp)
__attribute__nonnull__(pTHX_2)