patch 7.4.2176
Problem: #ifdefs in main() are complicated.
Solution: Always define vim_main2(). Move params to the file level.
(suggested by Ken Takata)
diff --git a/src/if_mzsch.c b/src/if_mzsch.c
index 7a462ad..4138810 100644
--- a/src/if_mzsch.c
+++ b/src/if_mzsch.c
@@ -1009,8 +1009,11 @@
#endif
int
-mzscheme_main(int argc, char** argv)
+mzscheme_main()
{
+ int argc = 0;
+ char *argv = NULL;
+
#ifdef DYNAMIC_MZSCHEME
/*
* Racket requires trampolined startup. We can not load it later.
@@ -1019,16 +1022,16 @@
if (!mzscheme_enabled(FALSE))
{
disabled = TRUE;
- return vim_main2(argc, argv);
+ return vim_main2();
}
#endif
#ifdef HAVE_TLS_SPACE
scheme_register_tls_space(&tls_space, _tls_index);
#endif
#ifdef TRAMPOLINED_MZVIM_STARTUP
- return scheme_main_setup(TRUE, mzscheme_env_main, argc, argv);
+ return scheme_main_setup(TRUE, mzscheme_env_main, argc, &argv);
#else
- return mzscheme_env_main(NULL, argc, argv);
+ return mzscheme_env_main(NULL, argc, &argv);
#endif
}
@@ -1056,7 +1059,7 @@
* We trampoline into vim_main2
* Passing argc, argv through from mzscheme_main
*/
- vim_main_result = vim_main2(argc, argv);
+ vim_main_result = vim_main2();
#if !defined(TRAMPOLINED_MZVIM_STARTUP) && defined(MZ_PRECISE_GC)
/* releasing dummy */
MZ_GC_REG();