This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
integrate cfgperl changes into mainline
[perl5.git] / win32 / runperl.c
CommitLineData
76e3520e
GS
1
2#ifdef PERL_OBJECT
3#define USE_SOCKETS_AS_HANDLES
4#include "EXTERN.h"
5#include "perl.h"
6
565764a8 7#define NO_XSLOCKS
76e3520e 8#include "XSUB.H"
0f4eea8f 9#include "win32iop.h"
c69f6586
GS
10
11#include <fcntl.h>
0f4eea8f 12#include "perlhost.h"
c69f6586 13
c69f6586 14
0f4eea8f
DL
15char *staticlinkmodules[] = {
16 "DynaLoader",
17 NULL,
c69f6586 18};
76e3520e 19
0f4eea8f 20EXTERN_C void boot_DynaLoader _((CV* cv _CPERLarg));
76e3520e 21
0f4eea8f
DL
22static void
23xs_init(CPERLarg)
76e3520e 24{
0f4eea8f
DL
25 char *file = __FILE__;
26 dXSUB_SYS;
27 newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
28}
76e3520e 29
0f4eea8f 30CPerlObj *pPerl;
76e3520e
GS
31
32#undef PERL_SYS_INIT
33#define PERL_SYS_INIT(a, c)
34
35int
36main(int argc, char **argv, char **env)
37{
c69f6586
GS
38 CPerlHost host;
39 int exitstatus = 1;
76e3520e 40
c69f6586
GS
41 if(!host.PerlCreate())
42 exit(exitstatus);
76e3520e 43
0f4eea8f 44 exitstatus = host.PerlParse(xs_init, argc, argv, NULL);
76e3520e 45
c69f6586 46 if (!exitstatus)
c69f6586 47 exitstatus = host.PerlRun();
76e3520e 48
c69f6586 49 host.PerlDestroy();
76e3520e
GS
50
51 return exitstatus;
52}
53
76e3520e
GS
54#else /* PERL_OBJECT */
55
a835ef8a 56#ifdef __GNUC__
5b0d9cbe
NIS
57/*
58 * GNU C does not do __declspec()
59 */
a835ef8a 60#define __declspec(foo)
5b0d9cbe
NIS
61
62/* Mingw32 defaults to globing command line
63 * This is inconsistent with other Win32 ports and
64 * seems to cause trouble with passing -DXSVERSION=\"1.6\"
65 * So we turn it off like this:
66 */
67int _CRT_glob = 0;
68
a835ef8a 69#endif
0a753a76 70
5b0d9cbe 71
390b85e7 72__declspec(dllimport) int RunPerl(int argc, char **argv, char **env, void *ios);
0a753a76 73
137443ea 74int
0a753a76
PP
75main(int argc, char **argv, char **env)
76{
390b85e7 77 return RunPerl(argc, argv, env, (void*)0);
0a753a76 78}
76e3520e
GS
79
80#endif /* PERL_OBJECT */