1 #ifdef _MSC_VER 2 #include <crtdbg.h> 3 #endif 4 5 #include "EXTERN.h" 6 #include "perl.h" 7 8 #ifdef __GNUC__ 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\" 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. 17 */ 18 #ifndef PERLDLL 19 int _CRT_glob = 0; 20 #endif 21 22 #endif 23 24 int 25 main(int argc, char **argv, char **env) 26 { 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 39 return RunPerl(argc, argv, env); 40 } 41 42 43