if ($PLATFORM eq 'win32') {
warn join(' ',keys %define)."\n";
- if ($define{PERL_OBJECT}) {
+ if ($define{PERL_OBJECT} || $define{MULTIPLICITY}) {
print "LIBRARY Perl56\n";
print "DESCRIPTION 'Perl interpreter'\n";
print "EXPORTS\n";
-# output_symbol("perl_alloc");
output_symbol("perl_get_host_info");
output_symbol("perl_alloc_override");
-# output_symbol("perl_construct");
-# output_symbol("perl_destruct");
-# output_symbol("perl_free");
-# output_symbol("perl_parse");
-# output_symbol("perl_run");
-# output_symbol("RunPerl");
-# exit(0);
}
else {
- print "LIBRARY Perl\n";
+ print "LIBRARY Perl56\n";
print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
print "EXPORTS\n";
}
}
}
-#ifdef PERL_OBJECT
-
EXTERN_C PerlInterpreter*
perl_alloc_override(struct IPerlMem** ppMem, struct IPerlMem** ppMemShared,
struct IPerlMem** ppMemParse, struct IPerlEnv** ppEnv,
struct IPerlProc** ppProc)
{
PerlInterpreter *my_perl = NULL;
- try
- {
- CPerlHost* pHost = new CPerlHost(ppMem, ppMemShared, ppMemParse, ppEnv,
- ppStdIO, ppLIO, ppDir, ppSock, ppProc);
-
- if (pHost) {
- my_perl = perl_alloc_using(pHost->m_pHostperlMem,
- pHost->m_pHostperlMemShared,
- pHost->m_pHostperlMemParse,
- pHost->m_pHostperlEnv,
- pHost->m_pHostperlStdIO,
- pHost->m_pHostperlLIO,
- pHost->m_pHostperlDir,
- pHost->m_pHostperlSock,
- pHost->m_pHostperlProc);
- if (my_perl) {
- CPerlObj* pPerl = (CPerlObj*)my_perl;
- w32_internal_host = pHost;
- }
+ CPerlHost* pHost = new CPerlHost(ppMem, ppMemShared, ppMemParse, ppEnv,
+ ppStdIO, ppLIO, ppDir, ppSock, ppProc);
+
+ if (pHost) {
+ my_perl = perl_alloc_using(pHost->m_pHostperlMem,
+ pHost->m_pHostperlMemShared,
+ pHost->m_pHostperlMemParse,
+ pHost->m_pHostperlEnv,
+ pHost->m_pHostperlStdIO,
+ pHost->m_pHostperlLIO,
+ pHost->m_pHostperlDir,
+ pHost->m_pHostperlSock,
+ pHost->m_pHostperlProc);
+ if (my_perl) {
+#ifdef PERL_OBJECT
+ CPerlObj* pPerl = (CPerlObj*)my_perl;
+#endif
+ w32_internal_host = pHost;
}
}
- catch(...)
- {
- win32_fprintf(stderr, "%s\n", "Error: Unable to allocate memory");
- my_perl = NULL;
- }
-
return my_perl;
}
perl_alloc(void)
{
PerlInterpreter* my_perl = NULL;
- try
- {
- CPerlHost* pHost = new CPerlHost();
- if (pHost) {
- my_perl = perl_alloc_using(pHost->m_pHostperlMem,
- pHost->m_pHostperlMemShared,
- pHost->m_pHostperlMemParse,
- pHost->m_pHostperlEnv,
- pHost->m_pHostperlStdIO,
- pHost->m_pHostperlLIO,
- pHost->m_pHostperlDir,
- pHost->m_pHostperlSock,
- pHost->m_pHostperlProc);
- if (my_perl) {
- CPerlObj* pPerl = (CPerlObj*)my_perl;
- w32_internal_host = pHost;
- }
+ CPerlHost* pHost = new CPerlHost();
+ if (pHost) {
+ my_perl = perl_alloc_using(pHost->m_pHostperlMem,
+ pHost->m_pHostperlMemShared,
+ pHost->m_pHostperlMemParse,
+ pHost->m_pHostperlEnv,
+ pHost->m_pHostperlStdIO,
+ pHost->m_pHostperlLIO,
+ pHost->m_pHostperlDir,
+ pHost->m_pHostperlSock,
+ pHost->m_pHostperlProc);
+ if (my_perl) {
+#ifdef PERL_OBJECT
+ CPerlObj* pPerl = (CPerlObj*)my_perl;
+#endif
+ w32_internal_host = pHost;
}
}
- catch(...)
- {
- win32_fprintf(stderr, "%s\n", "Error: Unable to allocate memory");
- my_perl = NULL;
- }
-
return my_perl;
}
+#ifdef PERL_OBJECT
+
EXTERN_C void
perl_construct(PerlInterpreter* my_perl)
{
#undef PL_perl_destruct_level
#define PL_perl_destruct_level int dummy
-#else /* !PERL_OBJECT */
-
-EXTERN_C PerlInterpreter*
-perl_alloc(void)
-{
- PerlInterpreter *my_perl = NULL;
- CPerlHost* pHost = new CPerlHost();
- if (pHost) {
- my_perl = perl_alloc_using(pHost->m_pHostperlMem,
- pHost->m_pHostperlMemShared,
- pHost->m_pHostperlMemParse,
- pHost->m_pHostperlEnv,
- pHost->m_pHostperlStdIO,
- pHost->m_pHostperlLIO,
- pHost->m_pHostperlDir,
- pHost->m_pHostperlSock,
- pHost->m_pHostperlProc);
- if (my_perl) {
- w32_internal_host = pHost;
- }
- }
- return my_perl;
-}
-
#endif /* PERL_OBJECT */
#endif /* PERL_IMPLICIT_SYS */