diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-07-09 11:34:22 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-09 11:34:22 -0700 |
commit | ba655d15b58ab2a00032b74e5b2617a0b658a01f (patch) | |
tree | d5085d283250abde9bbb8493e16c4d83e4f69090 /compat/mingw.h | |
parent | Merge branch 'jk/pretty-G-format-fixes' (diff) | |
parent | mingw: avoid const warning (diff) | |
download | tgif-ba655d15b58ab2a00032b74e5b2617a0b658a01f.tar.xz |
Merge branch 'sk/mingw-main'
* sk/mingw-main:
mingw: avoid const warning
Win32: move main macro to a function
Diffstat (limited to 'compat/mingw.h')
-rw-r--r-- | compat/mingw.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/compat/mingw.h b/compat/mingw.h index 3eaf822e28..6dc8b1a1b4 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -363,22 +363,16 @@ void free_environ(char **env); extern CRITICAL_SECTION pinfo_cs; /* - * A replacement of main() that ensures that argv[0] has a path - * and that default fmode and std(in|out|err) are in binary mode + * A replacement of main() that adds win32 specific initialization. */ +void mingw_startup(); #define main(c,v) dummy_decl_mingw_main(); \ static int mingw_main(c,v); \ int main(int argc, char **argv) \ { \ - extern CRITICAL_SECTION pinfo_cs; \ - _fmode = _O_BINARY; \ - _setmode(_fileno(stdin), _O_BINARY); \ - _setmode(_fileno(stdout), _O_BINARY); \ - _setmode(_fileno(stderr), _O_BINARY); \ - argv[0] = xstrdup(_pgmptr); \ - InitializeCriticalSection(&pinfo_cs); \ - return mingw_main(argc, argv); \ + mingw_startup(); \ + return mingw_main(__argc, (void *)__argv); \ } \ static int mingw_main(c,v) |