diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-06-27 14:28:49 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-06-27 14:28:49 +0000 |
commit | 0cb9638729211ea71a75ae8756c03ba21553bd53 (patch) | |
tree | f00e767824d620a63a26a857b6a37fcb6945f89d /win32/runperl.c | |
parent | 4f4e629e089f1120f8e94984281df06ac4f885c5 (diff) | |
download | perl-0cb9638729211ea71a75ae8756c03ba21553bd53.tar.gz |
somewhat untested PERL_OBJECT cleanups (C++isms mostly
gone from the public API); PERL_OBJECT builds again on
windows
TODO: namespace-clean the typedefs in iperlsys.h and
elsewhere; remove C++ remnants from public headers
p4raw-id: //depot/perl@3553
Diffstat (limited to 'win32/runperl.c')
-rw-r--r-- | win32/runperl.c | 78 |
1 files changed, 3 insertions, 75 deletions
diff --git a/win32/runperl.c b/win32/runperl.c index e9286702aa..ef4453138d 100644 --- a/win32/runperl.c +++ b/win32/runperl.c @@ -1,67 +1,6 @@ #include "EXTERN.h" #include "perl.h" -#ifdef PERL_OBJECT - -#define NO_XSLOCKS -#include "XSUB.H" -#include "win32iop.h" - -#include <fcntl.h> -#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; - -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 - - PERL_SYS_INIT(&argc,&argv); - - 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() @@ -78,23 +17,12 @@ int _CRT_glob = 0; #endif -__declspec(dllimport) int RunPerl(int argc, char **argv, char **env, void *ios); +__declspec(dllimport) int RunPerl(int argc, char **argv, char **env); 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 */ + |