From de27275fc94f673cd6f05dbba07ba8b50c488bb4 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Tue, 5 Sep 2017 18:48:27 -0400 Subject: [PATCH] CreateThread must specify storage for the thread identifier on <= win98 --- libretro-common/rthreads/rthreads.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libretro-common/rthreads/rthreads.c b/libretro-common/rthreads/rthreads.c index 20eddc0f9b..31c76cbc9c 100644 --- a/libretro-common/rthreads/rthreads.c +++ b/libretro-common/rthreads/rthreads.c @@ -159,7 +159,9 @@ sthread_t *sthread_create(void (*thread_func)(void*), void *userdata) bool thread_created = false; struct thread_data *data = NULL; sthread_t *thread = (sthread_t*)calloc(1, sizeof(*thread)); - +#if defined(_WIN32_WINNT) && _WIN32_WINNT <= 0x0410 + uint32_t thread_id = 0; +#endif if (!thread) return NULL; @@ -171,7 +173,11 @@ sthread_t *sthread_create(void (*thread_func)(void*), void *userdata) data->userdata = userdata; #ifdef USE_WIN32_THREADS - thread->thread = CreateThread(NULL, 0, thread_wrap, data, 0, NULL); +#if defined(_WIN32_WINNT) && _WIN32_WINNT <= 0x0410 + thread->thread = CreateThread(NULL, 0, thread_wrap, data, 0, &thread_id); +#else + thread->thread = CreateThread(NULL, 0, thread_wrap, data, 0, NULL); +#endif thread_created = !!thread->thread; #else #if defined(VITA)