mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Annotate callback functions with __stdcall on Windows
Fixes crash on exit on Windows x86.
This commit is contained in:
parent
55da62c1c1
commit
35ef9423e0
3 changed files with 18 additions and 2 deletions
|
@ -337,6 +337,13 @@ typedef struct {
|
|||
# undef BOOL
|
||||
#endif
|
||||
|
||||
/* Used to annotate callback functions with __stdcall on Windows. */
|
||||
#if defined(_WIN32)
|
||||
#define GS_WINAPI WINAPI
|
||||
#else
|
||||
#define GS_WINAPI
|
||||
#endif
|
||||
|
||||
/* Include the blocks runtime header if it's available (It shouldn't matter
|
||||
* that this doesn't work on compilers that don't support __has_include(),
|
||||
* because they also don't support blocks).
|
||||
|
|
|
@ -256,10 +256,18 @@ static id gs_objc_proxy_lookup(id receiver, SEL op)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __GNUSTEP_RUNTIME__
|
||||
static void GS_WINAPI
|
||||
exitedThread(void *slot)
|
||||
{
|
||||
free(slot);
|
||||
}
|
||||
#endif
|
||||
|
||||
+ (void) load
|
||||
{
|
||||
#ifdef __GNUSTEP_RUNTIME__
|
||||
GS_THREAD_KEY_INIT(thread_slot_key, free);
|
||||
GS_THREAD_KEY_INIT(thread_slot_key, exitedThread);
|
||||
__objc_msg_forward3 = gs_objc_msg_forward3;
|
||||
__objc_msg_forward2 = gs_objc_msg_forward2;
|
||||
objc_proxy_lookup = gs_objc_proxy_lookup;
|
||||
|
|
|
@ -642,7 +642,8 @@ unregisterActiveThread(NSThread *thread);
|
|||
* we must not call into NSAutoreleasePool unless the NSThread object can still
|
||||
* be found using GSCurrentThread()
|
||||
*/
|
||||
static void exitedThread(void *thread)
|
||||
static void GS_WINAPI
|
||||
exitedThread(void *thread)
|
||||
{
|
||||
if (thread != defaultThread)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue