1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Fix SDL threading on macOS/Linux.

And fixup pkg-config check for SDL on Linux.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
This commit is contained in:
Pāvels Nadtočajevs
2025-06-25 06:39:23 +03:00
committed by Rémi Verschelde
parent 05640191e7
commit 71dd7b5712
4 changed files with 9 additions and 63 deletions

View File

@@ -1,57 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_internal.h"
// Thread management routines for SDL
#include "../SDL_systhread.h"
bool SDL_SYS_CreateThread(SDL_Thread *thread,
SDL_FunctionPointer pfnBeginThread,
SDL_FunctionPointer pfnEndThread)
{
return SDL_SetError("Threads are not supported on this platform");
}
void SDL_SYS_SetupThread(const char *name)
{
return;
}
SDL_ThreadID SDL_GetCurrentThreadID(void)
{
return 0;
}
bool SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority)
{
return true;
}
void SDL_SYS_WaitThread(SDL_Thread *thread)
{
return;
}
void SDL_SYS_DetachThread(SDL_Thread *thread)
{
return;
}

View File

@@ -63,8 +63,12 @@ mkdir $target/sensor
cp -rv sensor/{*.{c,h},dummy} $target/sensor
mkdir $target/thread
cp -rv thread/{*.{c,h},generic,pthread,windows} $target/thread
rm -f $target/thread/generic/SDL_{sysmutex*.{c,h},systls.c}
cp -rv thread/{*.{c,h},pthread,windows} $target/thread
# Despite being 'generic', syssem.c is included in the Unix driver for macOS,
# and syscond/sysrwlock are used by the Windows driver.
# systhread_c.h is included by all these, but we should NOT compile the matching .c file.
mkdir $target/thread/generic
cp -v thread/generic/SDL_{syssem.c,{syscond,sysrwlock}*.{c,h},systhread_c.h} $target/thread/generic
mkdir $target/timer
cp -rv timer/{*.{c,h},unix,windows} $target/timer