X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=win32%2Frunperl.c;h=85fd8317593fd833e378cea1b5b2abdb232fd93d;hb=5095244257e3c5d9389813ccbcd2187ff6e2e91f;hp=1b569d2557aab9a62a52136213926a98aa4276f2;hpb=8ac9c18d0290aa1420a64753c37ce5c0f1523967;p=p5sagit%2Fp5-mst-13.2.git diff --git a/win32/runperl.c b/win32/runperl.c index 1b569d2..85fd831 100644 --- a/win32/runperl.c +++ b/win32/runperl.c @@ -1,73 +1,7 @@ #include "EXTERN.h" #include "perl.h" -#ifdef PERL_OBJECT - -#define NO_XSLOCKS -#include "XSUB.H" -#include "win32iop.h" - -#include -#include "perlhost.h" - - -char *staticlinkmodules[] = { - "DynaLoader", - NULL, -}; - -EXTERN_C void boot_DynaLoader _((CV* cv _CPERLarg)); - -static void -xs_init(CPERLarg) -{ - char *file = __FILE__; - dXSUB_SYS; - newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); -} - -CPerlObj *pPerl; - -#undef PERL_SYS_INIT -#define PERL_SYS_INIT(a, c) - -int -main(int argc, char **argv, char **env) -{ - CPerlHost host; - int exitstatus = 1; -#ifndef __BORLANDC__ - /* XXX this _may_ be a problem on some compilers (e.g. Borland) that - * want to free() argv after main() returns. As luck would have it, - * Borland's CRT does the right thing to argv[0] already. */ - char szModuleName[MAX_PATH]; - char *ptr; - - GetModuleFileName(NULL, szModuleName, sizeof(szModuleName)); - (void)win32_longpath(szModuleName); - argv[0] = szModuleName; -#endif - - if (!host.PerlCreate()) - exit(exitstatus); - - exitstatus = host.PerlParse(xs_init, argc, argv, NULL); - - if (!exitstatus) - exitstatus = host.PerlRun(); - - host.PerlDestroy(); - - return exitstatus; -} - -#else /* PERL_OBJECT */ - #ifdef __GNUC__ -/* - * GNU C does not do __declspec() - */ -#define __declspec(foo) /* Mingw32 defaults to globing command line * This is inconsistent with other Win32 ports and @@ -78,24 +12,10 @@ int _CRT_glob = 0; #endif - -__declspec(dllimport) int RunPerl(int argc, char **argv, char **env, void *ios); - int main(int argc, char **argv, char **env) { -#ifndef __BORLANDC__ - /* XXX this _may_ be a problem on some compilers (e.g. Borland) that - * want to free() argv after main() returns. As luck would have it, - * Borland's CRT does the right thing to argv[0] already. */ - char szModuleName[MAX_PATH]; - char *ptr; - - GetModuleFileName(NULL, szModuleName, sizeof(szModuleName)); - (void)win32_longpath(szModuleName); - argv[0] = szModuleName; -#endif - return RunPerl(argc, argv, env, (void*)0); + return RunPerl(argc, argv, env); } -#endif /* PERL_OBJECT */ +