diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-02-12 01:55:55 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-02-12 01:55:55 +0100 |
commit | bbc98db7c45ed9c8a6bbc7e2ac7c67180ccbab16 (patch) | |
tree | 8066ae85f9917e7b16f69beff79c630176fb7d40 /src/main.c | |
parent | efcb54b78cfc4f396531cdac6af37e183bc9ee53 (diff) |
updated for version 7.3.441v7.3.441
Problem: Newer versions of MzScheme (Racket) require earlier (trampolined)
initialisation.
Solution: Call mzscheme_main() early in main(). (Sergey Khorev)
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c index d1702fe570..d9f8df4b45 100644 --- a/src/main.c +++ b/src/main.c @@ -554,6 +554,31 @@ main debug_break_level = params.use_debug_break_level; #endif +#ifdef FEAT_MZSCHEME + /* + * Newer version of MzScheme (Racket) require earlier (trampolined) + * initialisation via scheme_main_setup. + * Implement this by initialising it as early as possible + * and splitting off remaining Vim main into vim_main2 + */ + { + /* Pack up preprocessed command line arguments. + * It is safe because Scheme does not access argc/argv. */ + char *args[2]; + args[0] = (char *)fname; + args[1] = (char *)¶ms; + return mzscheme_main(2, args); + } +} + +int vim_main2(int argc, char **argv) +{ + char_u *fname = (char_u *)argv[0]; + mparm_T params; + + memcpy(¶ms, argv[1], sizeof(params)); +#endif + /* Execute --cmd arguments. */ exe_pre_commands(¶ms); @@ -957,14 +982,8 @@ main /* * Call the main command loop. This never returns. - * For embedded MzScheme the main_loop will be called by Scheme - * for proper stack tracking - */ -#ifndef FEAT_MZSCHEME + */ main_loop(FALSE, FALSE); -#else - mzscheme_main(); -#endif return 0; } |