From 48ebc829e497e45174c977e446f6fc1ea181a663 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 22 May 2024 20:45:57 -0400 Subject: [PATCH] thread: Fix build, if SDL is built without an external C runtime. Fixes #9858. --- src/SDL_internal.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/SDL_internal.h b/src/SDL_internal.h index 99f13f6c49..9d5b6f8e9e 100644 --- a/src/SDL_internal.h +++ b/src/SDL_internal.h @@ -265,6 +265,14 @@ #error SDL_RENDER enabled without any backend drivers. #endif +#if !defined(HAVE_LIBC) +// If not using _any_ C runtime, these have to be defined before SDL_thread.h +// gets included, so SDL_CreateThread calls won't try to reference the +// (unavailable and unneeded) _beginthreadex/_endthreadex functions. +#define SDL_BeginThreadFunction NULL +#define SDL_EndThreadFunction NULL +#endif + #include #include