summaryrefslogtreecommitdiff
path: root/compat/mingw.h
diff options
context:
space:
mode:
authorSteffen Prohaska <prohaska@zib.de>2008-07-26 09:41:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-08-03 21:18:23 (GMT)
commit22537765f51de92115592ac0a15981b8d27ef908 (patch)
tree427e1a0d7751ab20ab274adf33395746d4b58674 /compat/mingw.h
parent57b0fc4516249e1aa86169718d148fbf2940dc0c (diff)
downloadgit-22537765f51de92115592ac0a15981b8d27ef908.zip
git-22537765f51de92115592ac0a15981b8d27ef908.tar.gz
git-22537765f51de92115592ac0a15981b8d27ef908.tar.bz2
Modify mingw_main() workaround to avoid link errors
With MinGW's gcc.exe (GCC) 3.4.5 (mingw special) GNU ld version 2.17.50 20060824 the old define caused link errors: git.o: In function `main': C:/msysgit/git/git.c:500: undefined reference to `mingw_main' collect2: ld returned 1 exit status The modified define works. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Acked-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/mingw.h')
-rw-r--r--compat/mingw.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/compat/mingw.h b/compat/mingw.h
index 290a9e6..a52e657 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -228,9 +228,10 @@ char **env_setenv(char **env, const char *name);
* A replacement of main() that ensures that argv[0] has a path
*/
-#define main(c,v) main(int argc, const char **argv) \
+#define main(c,v) dummy_decl_mingw_main(); \
+static int mingw_main(); \
+int main(int argc, const char **argv) \
{ \
- static int mingw_main(); \
argv[0] = xstrdup(_pgmptr); \
return mingw_main(argc, argv); \
} \