init routine.
p4raw-id: //depot/perl@15139
#if defined(USE_5005THREADS)
Ap |struct perl_thread* |new_struct_thread|struct perl_thread *t
#endif
+#if defined(USE_REENTRANT_API)
+Ap |void |reentrant_init
+#endif
Ap |void |call_atexit |ATEXIT_t fn|void *ptr
Apd |I32 |call_argv |const char* sub_name|I32 flags|char** argv
Apd |I32 |call_method |const char* methname|I32 flags
#if defined(USE_5005THREADS)
#define new_struct_thread Perl_new_struct_thread
#endif
+#if defined(USE_REENTRANT_API)
+#define reentrant_init Perl_reentrant_init
+#endif
#define call_atexit Perl_call_atexit
#define call_argv Perl_call_argv
#define call_method Perl_call_method
#if defined(USE_5005THREADS)
#define new_struct_thread(a) Perl_new_struct_thread(aTHX_ a)
#endif
+#if defined(USE_REENTRANT_API)
+#define reentrant_init() Perl_reentrant_init(aTHX)
+#endif
#define call_atexit(a,b) Perl_call_atexit(aTHX_ a,b)
#define call_argv(a,b,c) Perl_call_argv(aTHX_ a,b,c)
#define call_method(a,b) Perl_call_method(aTHX_ a,b)
Perl_op_free
Perl_pad_sv
Perl_new_struct_thread
+Perl_reentrant_init
Perl_call_atexit
Perl_call_argv
Perl_call_method
PERLVAR(Iregex_padav, AV*) /* All regex objects */
#ifdef USE_REENTRANT_API
-PERLVAR(Ireentrant_buffer, REBUF*) /* here we store the _r buffers */
+PERLVAR(Ireentrant_buffer, REENTBUF*) /* here we store the _r buffers */
#endif
#endif
#ifdef USE_REENTRANT_API
typedef struct {
- struct tm* tmbuff;
-} REBUF;
+ struct tm* tmbuf;
+} REENTBUF;
-#define localtime(a) (localtime_r((a),PL_reentrant_buffer->tmbuff) ? PL_reentrant_buffer->tmbuff : NULL)
-#define gmtime(a) (gmtime_r((a),PL_reentrant_buffer->tmbuff) ? PL_reentrant_buffer->tmbuff : NULL)
+#define localtime(a) (localtime_r((a),PL_reentrant_buffer->tmbuf) ? PL_reentrant_buffer->tmbuf : NULL)
+#define gmtime(a) (gmtime_r((a),PL_reentrant_buffer->tmbuf) ? PL_reentrant_buffer->tmbuf : NULL)
#ifdef OLD_PTHREADS_API
#undef localtime
#undef gmtime
-#define localtime(a) ((localtime_r((a),PL_reentrant_buffer->tmbuff) == 0) ? PL_reentrant_buffer->tmbuff : NULL)
-#define gmtime(a) ((gmtime_r((a),PL_reentrant_buffer->tmbuff) == 0) ? PL_reentrant_buffer->tmbuff : NULL)
+#define localtime(a) ((localtime_r((a),PL_reentrant_buffer->tmbuf) == 0) ? PL_reentrant_buffer->tmbuf : NULL)
+#define gmtime(a) ((gmtime_r((a),PL_reentrant_buffer->tmbuf) == 0) ? PL_reentrant_buffer->tmbuf : NULL)
#endif /* HP-UX 10.20 */
#endif
PL_regex_pad = AvARRAY(PL_regex_padav);
#endif
#ifdef USE_REENTRANT_API
- New(31337, PL_reentrant_buffer,1, REBUF);
- New(31337, PL_reentrant_buffer->tmbuff,1, struct tm);
+ Perl_reentrant_init(aTHX);
#endif
/* Note that strtab is a rather special HV. Assumptions are made
#endif /* USE_5005THREADS */
#ifdef USE_REENTRANT_API
- Safefree(PL_reentrant_buffer->tmbuff);
+ Safefree(PL_reentrant_buffer->tmbuf);
Safefree(PL_reentrant_buffer);
#endif
#if defined(USE_5005THREADS)
PERL_CALLCONV struct perl_thread* Perl_new_struct_thread(pTHX_ struct perl_thread *t);
#endif
+#if defined(USE_REENTRANT_API)
+PERL_CALLCONV void Perl_reentrant_init(pTHX);
+#endif
PERL_CALLCONV void Perl_call_atexit(pTHX_ ATEXIT_t fn, void *ptr);
PERL_CALLCONV I32 Perl_call_argv(pTHX_ const char* sub_name, I32 flags, char** argv);
PERL_CALLCONV I32 Perl_call_method(pTHX_ const char* methname, I32 flags);
PL_debug = proto_perl->Idebug;
#ifdef USE_REENTRANT_API
- New(31337, PL_reentrant_buffer,1, REBUF);
- New(31337, PL_reentrant_buffer->tmbuff,1, struct tm);
+ Perl_reentrant_init(aTHX);
#endif
/* create SV map for pointer relocation */
{
}
+void
+Perl_reentrant_init(pTHX)
+{
+#ifdef USE_REENTRANT_API
+ New(31337, PL_reentrant_buffer, 1, REENTBUF);
+ New(31337, PL_reentrant_buffer->tmbuf, 1, struct tm);
+#endif
+}
+