patch 9.1.0630: MS-Windows: build fails with VIMDLL and mzscheme
Problem: MS-Windows: build fails with VIMDLL and mzscheme
Solution: define scheme_register_tls_space() inside gvim.exe
and refer to it from the dll (Ken Takata).
`scheme_register_tls_space()` doesn't support a thread-local variable in
a DLL:
https://docs.racket-lang.org/inside/im_memoryalloc.html#%28cpp._scheme_register_tls_space%29
closes: #15363
Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
4100852e09
commit
f0ce176b5f
@ -70,3 +70,24 @@ wmainCRTStartup(void)
|
||||
}
|
||||
# endif
|
||||
#endif // USE_OWNSTARTUP
|
||||
|
||||
|
||||
#if defined(VIMDLL) && defined(FEAT_MZSCHEME)
|
||||
|
||||
# if defined(_MSC_VER)
|
||||
static __declspec(thread) void *tls_space;
|
||||
extern intptr_t _tls_index;
|
||||
# elif defined(__MINGW32__)
|
||||
static __thread void *tls_space;
|
||||
extern intptr_t _tls_index;
|
||||
# endif
|
||||
|
||||
// Get TLS information that is needed for if_mzsch.
|
||||
__declspec(dllexport) void
|
||||
get_tls_info(void ***ptls_space, intptr_t *ptls_index)
|
||||
{
|
||||
*ptls_space = &tls_space;
|
||||
*ptls_index = _tls_index;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user