Squashed commit of the following:

commit 6b8f933589aa3925978a23e77a305a7e89c6ae4a
Author: Xing Ji <jixingcn@gmail.com>
Date:   Wed Mar 24 22:31:29 2021 +0800

    update the dynapi by `gendynapi.pl`

commit ebd1790c19983b652713f40ab1e139e485e1a2b7
Author: Xing Ji <jixingcn@gmail.com>
Date:   Wed Mar 24 22:17:48 2021 +0800

    revert the change in src/dynapi

commit 734b5f85c1613070081e39238e84198128971b53
Merge: 5a56e5a8 5ac6bd54
Author: Xing Ji <jixingcn@gmail.com>
Date:   Wed Mar 24 22:14:40 2021 +0800

    Merge remote-tracking branch 'libsdl/main' into jixingcn

commit 5a56e5a8227d9cff6b497b681c618a76bec1cae1
Author: Xing Ji <jixingcn@gmail.com>
Date:   Mon Mar 22 23:55:10 2021 +0800

    Fix #3596, can call the `SDL_TLSCleanup` to cleanup the TLS data when closing the application
This commit is contained in:
Xing Ji 2021-03-24 22:42:47 +08:00 committed by Sam Lantinga
parent 5ceb674426
commit fb283a732a
4 changed files with 7 additions and 1 deletions

View File

@ -435,6 +435,10 @@ extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id);
*/
extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*));
/**
* \brief Cleanup all TLS data for this thread.
*/
extern DECLSPEC void SDLCALL SDL_TLSCleanup(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

View File

@ -809,3 +809,4 @@
#define SDL_isgraph SDL_isgraph_REAL
#define SDL_AndroidShowToast SDL_AndroidShowToast_REAL
#define SDL_GetAudioDeviceSpec SDL_GetAudioDeviceSpec_REAL
#define SDL_TLSCleanup SDL_TLSCleanup_REAL

View File

@ -874,3 +874,4 @@ SDL_DYNAPI_PROC(int,SDL_isgraph,(int a),(a),return)
SDL_DYNAPI_PROC(int,SDL_AndroidShowToast,(const char *a, int b, int c, int d, int e),(a,b,c,d,e),return)
#endif
SDL_DYNAPI_PROC(int,SDL_GetAudioDeviceSpec,(int a, int b, SDL_AudioSpec *c),(a,b,c),return)
SDL_DYNAPI_PROC(void,SDL_TLSCleanup,(void),(),)

View File

@ -82,7 +82,7 @@ SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void *))
return 0;
}
static void
void
SDL_TLSCleanup()
{
SDL_TLSData *storage;