update sdl to 2.32.6

This commit is contained in:
AzaezelX 2025-05-24 13:39:03 -05:00
parent e557f5962b
commit ddc1f8c1e2
1339 changed files with 53966 additions and 19207 deletions

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
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
@ -30,7 +30,7 @@
#include "SDL_loadso.h"
#if SDL_VIDEO_DRIVER_UIKIT
#ifdef SDL_VIDEO_DRIVER_UIKIT
#include "../../video/uikit/SDL_uikitvideo.h"
#endif
@ -39,7 +39,7 @@ void *SDL_LoadObject(const char *sofile)
void *handle;
const char *loaderror;
#if SDL_VIDEO_DRIVER_UIKIT
#ifdef SDL_VIDEO_DRIVER_UIKIT
if (!UIKit_IsSystemVersionAtLeast(8.0)) {
SDL_SetError("SDL_LoadObject requires iOS 8+");
return NULL;
@ -48,7 +48,7 @@ void *SDL_LoadObject(const char *sofile)
handle = dlopen(sofile, RTLD_NOW | RTLD_LOCAL);
loaderror = dlerror();
if (handle == NULL) {
if (!handle) {
SDL_SetError("Failed loading %s: %s", sofile, loaderror);
}
return handle;
@ -57,7 +57,7 @@ void *SDL_LoadObject(const char *sofile)
void *SDL_LoadFunction(void *handle, const char *name)
{
void *symbol = dlsym(handle, name);
if (symbol == NULL) {
if (!symbol) {
/* prepend an underscore for platforms that need that. */
SDL_bool isstack;
size_t len = SDL_strlen(name) + 1;
@ -66,7 +66,7 @@ void *SDL_LoadFunction(void *handle, const char *name)
SDL_memcpy(&_name[1], name, len);
symbol = dlsym(handle, _name);
SDL_small_free(_name, isstack);
if (symbol == NULL) {
if (!symbol) {
SDL_SetError("Failed loading %s: %s", name,
(const char *)dlerror());
}
@ -76,7 +76,7 @@ void *SDL_LoadFunction(void *handle, const char *name)
void SDL_UnloadObject(void *handle)
{
if (handle != NULL) {
if (handle) {
dlclose(handle);
}
}

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
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

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
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
@ -90,7 +90,7 @@ void *SDL_LoadFunction(void *handle, const char *name)
void SDL_UnloadObject(void *handle)
{
if (handle != NULL) {
if (handle) {
DosFreeModule((HMODULE)handle);
}
}

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
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
@ -32,26 +32,26 @@
void *SDL_LoadObject(const char *sofile)
{
void *handle;
LPTSTR tstr;
LPWSTR wstr;
if (sofile == NULL) {
if (!sofile) {
SDL_InvalidParamError("sofile");
return NULL;
}
tstr = WIN_UTF8ToString(sofile);
wstr = WIN_UTF8ToStringW(sofile);
#ifdef __WINRT__
/* WinRT only publicly supports LoadPackagedLibrary() for loading .dll
files. LoadLibrary() is a private API, and not available for apps
(that can be published to MS' Windows Store.)
*/
handle = (void *)LoadPackagedLibrary(tstr, 0);
handle = (void *)LoadPackagedLibrary(wstr, 0);
#else
handle = (void *)LoadLibrary(tstr);
handle = (void *)LoadLibraryW(wstr);
#endif
SDL_free(tstr);
SDL_free(wstr);
/* Generate an error message if all loads failed */
if (handle == NULL) {
if (!handle) {
char errbuf[512];
SDL_strlcpy(errbuf, "Failed loading ", SDL_arraysize(errbuf));
SDL_strlcat(errbuf, sofile, SDL_arraysize(errbuf));
@ -63,7 +63,7 @@ void *SDL_LoadObject(const char *sofile)
void *SDL_LoadFunction(void *handle, const char *name)
{
void *symbol = (void *)GetProcAddress((HMODULE)handle, name);
if (symbol == NULL) {
if (!symbol) {
char errbuf[512];
SDL_strlcpy(errbuf, "Failed loading ", SDL_arraysize(errbuf));
SDL_strlcat(errbuf, name, SDL_arraysize(errbuf));
@ -74,7 +74,7 @@ void *SDL_LoadFunction(void *handle, const char *name)
void SDL_UnloadObject(void *handle)
{
if (handle != NULL) {
if (handle) {
FreeLibrary((HMODULE)handle);
}
}