Skip to content

Commit 2253776

Browse files
sprohaskagitster
authored andcommitted
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>
1 parent 57b0fc4 commit 2253776

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compat/mingw.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,10 @@ char **env_setenv(char **env, const char *name);
228228
* A replacement of main() that ensures that argv[0] has a path
229229
*/
230230

231-
#define main(c,v) main(int argc, const char **argv) \
231+
#define main(c,v) dummy_decl_mingw_main(); \
232+
static int mingw_main(); \
233+
int main(int argc, const char **argv) \
232234
{ \
233-
static int mingw_main(); \
234235
argv[0] = xstrdup(_pgmptr); \
235236
return mingw_main(argc, argv); \
236237
} \

0 commit comments

Comments
 (0)