diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:05:15 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:05:15 +0000 |
commit | 6e9cd6b491267e6dff3e3f3f37d8af5f28e40672 (patch) | |
tree | 35661af16c4a0ef2a9a8e225d2d5cc82605ea289 /src/if_mzsch.c | |
parent | Adding upstream version 2:9.1.0496. (diff) | |
download | vim-6e9cd6b491267e6dff3e3f3f37d8af5f28e40672.tar.xz vim-6e9cd6b491267e6dff3e3f3f37d8af5f28e40672.zip |
Adding upstream version 2:9.1.0698.upstream/2%9.1.0698
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/if_mzsch.c')
-rw-r--r-- | src/if_mzsch.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/if_mzsch.c b/src/if_mzsch.c index 9a9c487..4a8644c 100644 --- a/src/if_mzsch.c +++ b/src/if_mzsch.c @@ -383,7 +383,7 @@ static void (*dll_scheme_set_config_path)(Scheme_Object *p); # define scheme_null dll_scheme_null # define scheme_true dll_scheme_true -// pointers are GetProceAddress'ed as pointers to pointer +// pointers are GetProcAddress'ed as pointers to pointer #if !defined(USE_THREAD_LOCAL) && !defined(LINK_EXTENSIONS_BY_TABLE) # define scheme_current_thread (*dll_scheme_current_thread_ptr) # endif @@ -924,7 +924,7 @@ mzscheme_end(void) #endif } -#if HAVE_TLS_SPACE +#if HAVE_TLS_SPACE && !defined(VIMDLL) # if defined(_MSC_VER) static __declspec(thread) void *tls_space; extern intptr_t _tls_index; @@ -960,7 +960,24 @@ mzscheme_main(void) } #endif #ifdef HAVE_TLS_SPACE +# ifdef VIMDLL + void **ptls_space; + intptr_t tls_index; + void (*pget_tls_info)(void ***ptls_space, intptr_t *ptls_index); + + // Get the address of get_tls_info() from (g)vim.exe. + pget_tls_info = (void *)GetProcAddress( + GetModuleHandle(NULL), "get_tls_info"); + if (pget_tls_info == NULL) + { + disabled = TRUE; + return vim_main2(); + } + pget_tls_info(&ptls_space, &tls_index); + scheme_register_tls_space(ptls_space, tls_index); +# else scheme_register_tls_space(&tls_space, _tls_index); +# endif #endif #ifdef TRAMPOLINED_MZVIM_STARTUP return scheme_main_setup(TRUE, mzscheme_env_main, argc, &argv); |