X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=win32%2Frunperl.c;h=3947f9ef377299c322f34302611eec034dcfddd4;hb=e200fe592a4997f548ebec319b6bc13065a09d24;hp=507b3831f522528c0a1a9e0ecf04a4fc1b7bd7e2;hpb=0a753a764065f2260004b6e6975085378b850346;p=p5sagit%2Fp5-mst-13.2.git diff --git a/win32/runperl.c b/win32/runperl.c index 507b383..3947f9e 100644 --- a/win32/runperl.c +++ b/win32/runperl.c @@ -1,10 +1,80 @@ -#include -#include -extern WIN32_IOSUBSYSTEM win32stdio; -extern int RunPerl(int argc, char **argv, char **env, void *iosubsystem); +#ifdef PERL_OBJECT +#define USE_SOCKETS_AS_HANDLES +#include "EXTERN.h" +#include "perl.h" +#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; + + 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 + * seems to cause trouble with passing -DXSVERSION=\"1.6\" + * So we turn it off like this: + */ +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) { - return (RunPerl(argc, argv, env, &win32stdio)); + return RunPerl(argc, argv, env, (void*)0); } + +#endif /* PERL_OBJECT */