Skip to content

Commit 18ef2d8

Browse files
committed
Merge tag 'release-2.32.8'
2 parents 108eb91 + 98d1f3a commit 18ef2d8

File tree

16 files changed

+34
-60
lines changed

16 files changed

+34
-60
lines changed

android-project/app/src/main/java/org/libsdl/app/SDLActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
6161
private static final String TAG = "SDL";
6262
private static final int SDL_MAJOR_VERSION = 2;
6363
private static final int SDL_MINOR_VERSION = 32;
64-
private static final int SDL_MICRO_VERSION = 6;
64+
private static final int SDL_MICRO_VERSION = 8;
6565
/*
6666
// Display InputType.SOURCE/CLASS of events and devices
6767
//

include/SDL_stdinc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,12 @@ size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
750750
size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
751751
#endif
752752

753+
#ifndef _WIN32
753754
/* strdup is not ANSI but POSIX, and its prototype might be hidden... */
755+
/* not for windows: might conflict with string.h where strdup may have
756+
* dllimport attribute: https://github.com/libsdl-org/SDL/issues/12948 */
754757
char *strdup(const char *str);
758+
#endif
755759

756760
/* Starting LLVM 16, the analyser errors out if these functions do not have
757761
their prototype defined (clang-diagnostic-implicit-function-declaration) */

include/SDL_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ typedef struct SDL_version
5858
*/
5959
#define SDL_MAJOR_VERSION 2
6060
#define SDL_MINOR_VERSION 32
61-
#define SDL_PATCHLEVEL 6
61+
#define SDL_PATCHLEVEL 8
6262

6363
/**
6464
* Macro to determine SDL version program was compiled against.

src/cpuinfo/SDL_cpuinfo.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@
127127
#define CPU_CFG2_LSX (1 << 6)
128128
#define CPU_CFG2_LASX (1 << 7)
129129

130-
#if defined(SDL_ALTIVEC_BLITTERS) && defined(HAVE_SETJMP) && !defined(__MACOSX__) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
130+
#if !defined(SDL_CPUINFO_DISABLED) && \
131+
!((defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))) || (defined(__OpenBSD__) && defined(__powerpc__))) && \
132+
!(defined(__FreeBSD__) && defined(__powerpc__)) && \
133+
!(defined(__LINUX__) && defined(__powerpc__) && defined(HAVE_GETAUXVAL)) && \
134+
defined(SDL_ALTIVEC_BLITTERS) && defined(HAVE_SETJMP)
131135
/* This is the brute force way of detecting instruction sets...
132136
the idea is borrowed from the libmpeg2 library - thanks!
133137
*/
@@ -356,6 +360,8 @@ static int CPU_haveAltiVec(void)
356360
elf_aux_info(AT_HWCAP, &cpufeatures, sizeof(cpufeatures));
357361
altivec = cpufeatures & PPC_FEATURE_HAS_ALTIVEC;
358362
return altivec;
363+
#elif defined(__LINUX__) && defined(__powerpc__) && defined(HAVE_GETAUXVAL)
364+
altivec = getauxval(AT_HWCAP) & PPC_FEATURE_HAS_ALTIVEC;
359365
#elif defined(SDL_ALTIVEC_BLITTERS) && defined(HAVE_SETJMP)
360366
void (*handler)(int sig);
361367
handler = signal(SIGILL, illegal_instruction);

src/events/SDL_events.c

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -738,21 +738,17 @@ static void SDL_CutEvent(SDL_EventEntry *entry)
738738

739739
static int SDL_SendWakeupEvent(void)
740740
{
741+
SDL_Window *wakeup_window;
741742
SDL_VideoDevice *_this = SDL_GetVideoDevice();
742743
if (_this == NULL || !_this->SendWakeupEvent) {
743744
return 0;
744745
}
745746

746-
SDL_LockMutex(_this->wakeup_lock);
747-
{
748-
if (_this->wakeup_window) {
749-
_this->SendWakeupEvent(_this, _this->wakeup_window);
750-
751-
/* No more wakeup events needed until we enter a new wait */
752-
_this->wakeup_window = NULL;
753-
}
747+
/* We only want to do this once while waiting for an event, so set it to NULL atomically here */
748+
wakeup_window = (SDL_Window *)SDL_AtomicSetPtr(&_this->wakeup_window, NULL);
749+
if (wakeup_window) {
750+
_this->SendWakeupEvent(_this, wakeup_window);
754751
}
755-
SDL_UnlockMutex(_this->wakeup_lock);
756752

757753
return 0;
758754
}
@@ -1009,18 +1005,7 @@ static int SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Eve
10091005
int status;
10101006
SDL_PumpEventsInternal(SDL_TRUE);
10111007

1012-
SDL_LockMutex(_this->wakeup_lock);
1013-
{
1014-
status = SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT);
1015-
/* If status == 0 we are going to block so wakeup will be needed. */
1016-
if (status == 0) {
1017-
_this->wakeup_window = wakeup_window;
1018-
} else {
1019-
_this->wakeup_window = NULL;
1020-
}
1021-
}
1022-
SDL_UnlockMutex(_this->wakeup_lock);
1023-
1008+
status = SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT);
10241009
if (status < 0) {
10251010
/* Got an error: return */
10261011
break;
@@ -1033,8 +1018,6 @@ static int SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Eve
10331018
if (timeout > 0) {
10341019
Uint32 elapsed = SDL_GetTicks() - start;
10351020
if (elapsed >= (Uint32)timeout) {
1036-
/* Set wakeup_window to NULL without holding the lock. */
1037-
_this->wakeup_window = NULL;
10381021
return 0;
10391022
}
10401023
loop_timeout = (int)((Uint32)timeout - elapsed);
@@ -1049,9 +1032,9 @@ static int SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Eve
10491032
}
10501033
}
10511034

1035+
SDL_AtomicSetPtr(&_this->wakeup_window, wakeup_window);
10521036
status = _this->WaitEventTimeout(_this, loop_timeout);
1053-
/* Set wakeup_window to NULL without holding the lock. */
1054-
_this->wakeup_window = NULL;
1037+
SDL_AtomicSetPtr(&_this->wakeup_window, NULL);
10551038
if (status == 0 && poll_interval != SDL_MAX_SINT16 && loop_timeout == poll_interval) {
10561039
/* We may have woken up to poll. Try again */
10571040
continue;

src/joystick/hidapi/SDL_hidapijoystick.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,11 +822,12 @@ SDL_bool HIDAPI_JoystickConnected(SDL_HIDAPI_Device *device, SDL_JoystickID *pJo
822822

823823
++SDL_HIDAPI_numjoysticks;
824824

825-
SDL_PrivateJoystickAdded(joystickID);
826-
827825
if (pJoystickID) {
828826
*pJoystickID = joystickID;
829827
}
828+
829+
SDL_PrivateJoystickAdded(joystickID);
830+
830831
return SDL_TRUE;
831832
}
832833

src/main/windows/version.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
99
//
1010

1111
VS_VERSION_INFO VERSIONINFO
12-
FILEVERSION 2,32,6,0
13-
PRODUCTVERSION 2,32,6,0
12+
FILEVERSION 2,32,8,0
13+
PRODUCTVERSION 2,32,8,0
1414
FILEFLAGSMASK 0x3fL
1515
FILEFLAGS 0x0L
1616
FILEOS 0x40004L
@@ -23,12 +23,12 @@ BEGIN
2323
BEGIN
2424
VALUE "CompanyName", "\0"
2525
VALUE "FileDescription", "SDL\0"
26-
VALUE "FileVersion", "2, 32, 6, 0\0"
26+
VALUE "FileVersion", "2, 32, 8, 0\0"
2727
VALUE "InternalName", "SDL\0"
2828
VALUE "LegalCopyright", "Copyright (C) 2025 Sam Lantinga\0"
2929
VALUE "OriginalFilename", "SDL2.dll\0"
3030
VALUE "ProductName", "Simple DirectMedia Layer\0"
31-
VALUE "ProductVersion", "2, 32, 6, 0\0"
31+
VALUE "ProductVersion", "2, 32, 8, 0\0"
3232
END
3333
END
3434
BLOCK "VarFileInfo"

src/render/opengles2/SDL_render_gles2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,8 +2221,8 @@ SDL_RenderDriver GLES2_RenderDriver = {
22212221
{ "opengles2",
22222222
(SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE),
22232223
4,
2224-
{ SDL_PIXELFORMAT_BGRA32,
2225-
SDL_PIXELFORMAT_ABGR32,
2224+
{ SDL_PIXELFORMAT_RGBA32,
2225+
SDL_PIXELFORMAT_BGRA32,
22262226
SDL_PIXELFORMAT_BGRX32,
22272227
SDL_PIXELFORMAT_RGBX32 },
22282228
0,

src/render/ps2/SDL_render_ps2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ typedef struct
5555
static int vsync_sema_id = 0;
5656

5757
/* PRIVATE METHODS */
58-
static int vsync_handler(void)
58+
static int vsync_handler(int reason)
5959
{
6060
iSignalSema(vsync_sema_id);
6161

src/video/SDL_sysvideo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,7 @@ struct SDL_VideoDevice
355355
SDL_bool checked_texture_framebuffer;
356356
SDL_bool is_dummy;
357357
SDL_bool suspend_screensaver;
358-
SDL_Window *wakeup_window;
359-
SDL_mutex *wakeup_lock; /* Initialized only if WaitEventTimeout/SendWakeupEvent are supported */
358+
void *wakeup_window;
360359
int num_displays;
361360
SDL_VideoDisplay *displays;
362361
SDL_Window *windows;

0 commit comments

Comments
 (0)