Commit | Line | Data |
---|---|---|
924c839e SH |
1 | #ifdef _MSC_VER |
2 | #include <crtdbg.h> | |
3 | #endif | |
4 | ||
76e3520e GS |
5 | #include "EXTERN.h" |
6 | #include "perl.h" | |
7 | ||
a835ef8a | 8 | #ifdef __GNUC__ |
5b0d9cbe NIS |
9 | |
10 | /* Mingw32 defaults to globing command line | |
11 | * This is inconsistent with other Win32 ports and | |
12 | * seems to cause trouble with passing -DXSVERSION=\"1.6\" | |
ed2eab3f SH |
13 | * So we turn it off like this, but only when compiling |
14 | * perlmain.c: perlmainst.c is linked into the same executable | |
15 | * as win32.c, which also does this, so we mustn't do it twice | |
16 | * otherwise we get a multiple definition error. | |
5b0d9cbe | 17 | */ |
ed2eab3f | 18 | #ifndef PERLDLL |
5b0d9cbe | 19 | int _CRT_glob = 0; |
ed2eab3f | 20 | #endif |
5b0d9cbe | 21 | |
a835ef8a | 22 | #endif |
0a753a76 | 23 | |
137443ea | 24 | int |
0a753a76 | 25 | main(int argc, char **argv, char **env) |
26 | { | |
924c839e SH |
27 | #ifdef _MSC_VER |
28 | /* Arrange for _CrtDumpMemoryLeaks() to be called automatically at program | |
29 | * termination when built with CFG = DebugFull. */ | |
30 | int currentFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); | |
31 | currentFlag |= _CRTDBG_LEAK_CHECK_DF; | |
32 | _CrtSetDbgFlag(currentFlag); | |
33 | ||
34 | /* Change this -1 to the allocation number of any reported memory leaks to | |
35 | * break on the allocation call that was leaked. */ | |
36 | _CrtSetBreakAlloc(-1L); | |
37 | #endif | |
38 | ||
0cb96387 | 39 | return RunPerl(argc, argv, env); |
0a753a76 | 40 | } |
76e3520e | 41 | |
0cb96387 | 42 |