summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-10-17 22:30:30 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-10-17 22:30:30 +0000
commit32e30700cf966bf527dceb0482a205346d2d955f (patch)
treea5b4102b6616576066873d7e95800c248982bb4b /perl.c
parenta7ec2b44b6a6713a67d2b7d1975eb72a28c1caf5 (diff)
downloadperl-32e30700cf966bf527dceb0482a205346d2d955f.tar.gz
support PERL_IMPLICIT_SYS with MULTIPLICITY/USE_THREADS on
windows p4raw-id: //depot/perl@4402
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c38
1 files changed, 31 insertions, 7 deletions
diff --git a/perl.c b/perl.c
index 2d4115451e..6e9ffaab4e 100644
--- a/perl.c
+++ b/perl.c
@@ -47,16 +47,43 @@ static I32 read_e_script(pTHXo_ int idx, SV *buf_sv, int maxlen);
#endif
#ifdef PERL_OBJECT
-CPerlObj* perl_alloc(IPerlMem* ipM, IPerlEnv* ipE, IPerlStdIO* ipStd,
- IPerlLIO* ipLIO, IPerlDir* ipD, IPerlSock* ipS, IPerlProc* ipP)
+CPerlObj*
+perl_alloc(struct IPerlMem* ipM, struct IPerlEnv* ipE,
+ struct IPerlStdIO* ipStd, struct IPerlLIO* ipLIO,
+ struct IPerlDir* ipD, struct IPerlSock* ipS,
+ struct IPerlProc* ipP)
{
CPerlObj* pPerl = new(ipM) CPerlObj(ipM, ipE, ipStd, ipLIO, ipD, ipS, ipP);
- if(pPerl != NULL)
+ if (pPerl != NULL)
pPerl->Init();
return pPerl;
}
#else
+
+#ifdef PERL_IMPLICIT_SYS
+PerlInterpreter *
+perl_alloc_using(struct IPerlMem* ipM, struct IPerlEnv* ipE,
+ struct IPerlStdIO* ipStd, struct IPerlLIO* ipLIO,
+ struct IPerlDir* ipD, struct IPerlSock* ipS,
+ struct IPerlProc* ipP)
+{
+ PerlInterpreter *my_perl;
+
+ /* New() needs interpreter, so call malloc() instead */
+ my_perl = (PerlInterpreter*)(*ipM->pMalloc)(ipM, sizeof(PerlInterpreter));
+ PERL_SET_INTERP(my_perl);
+ Zero(my_perl, 1, PerlInterpreter);
+ PL_Mem = ipM;
+ PL_Env = ipE;
+ PL_StdIO = ipStd;
+ PL_LIO = ipLIO;
+ PL_Dir = ipD;
+ PL_Sock = ipS;
+ PL_Proc = ipP;
+ return my_perl;
+}
+#else
PerlInterpreter *
perl_alloc(void)
{
@@ -67,6 +94,7 @@ perl_alloc(void)
PERL_SET_INTERP(my_perl);
return my_perl;
}
+#endif /* PERL_IMPLICIT_SYS */
#endif /* PERL_OBJECT */
void
@@ -80,10 +108,6 @@ perl_construct(pTHXx)
#endif /* USE_THREADS */
#ifdef MULTIPLICITY
- Zero(my_perl, 1, PerlInterpreter);
-#endif
-
-#ifdef MULTIPLICITY
init_interp();
PL_perl_destruct_level = 1;
#else