Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
private static final String TAG = "SDL";
private static final int SDL_MAJOR_VERSION = 2;
private static final int SDL_MINOR_VERSION = 32;
private static final int SDL_MICRO_VERSION = 2;
private static final int SDL_MICRO_VERSION = 4;
/*
// Display InputType.SOURCE/CLASS of events and devices
//
Expand Down
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub fn build(b: *std.Build) void {

const lib = b.addLibrary(.{
.name = "SDL2",
.version = .{ .major = 2, .minor = 32, .patch = 2 },
.version = .{ .major = 2, .minor = 32, .patch = 4 },
.linkage = if (t.abi.isAndroid()) .dynamic else .static,
.root_module = b.createModule(.{
.target = target,
Expand Down
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.{
.name = .SDL,
.version = "2.32.2",
.version = "2.32.4",
.fingerprint = 0x7ac4ce41df223a25,
.minimum_zig_version = "0.14.0",
.dependencies = .{},
Expand Down
4 changes: 2 additions & 2 deletions include/SDL_render.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window,
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_CreateRenderer
* \sa SDL_CreateWindowRenderer
* \sa SDL_CreateWindowAndRenderer
* \sa SDL_DestroyRenderer
*/
extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface);
Expand Down Expand Up @@ -787,7 +787,7 @@ extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer,
* Get the current render target.
*
* The default render target is the window for which the renderer was created,
* and is reported a NULL here.
* and is reported as NULL here.
*
* \param renderer the rendering context.
* \returns the current render target or NULL for the default render target.
Expand Down
2 changes: 1 addition & 1 deletion include/SDL_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ typedef struct SDL_version
*/
#define SDL_MAJOR_VERSION 2
#define SDL_MINOR_VERSION 32
#define SDL_PATCHLEVEL 2
#define SDL_PATCHLEVEL 4

/**
* Macro to determine SDL version program was compiled against.
Expand Down
33 changes: 15 additions & 18 deletions src/SDL_assert.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,7 @@
#endif

#if defined(__EMSCRIPTEN__)
#include <emscripten.h>
/* older Emscriptens don't have this, but we need to for wasm64 compatibility. */
#ifndef MAIN_THREAD_EM_ASM_PTR
#ifdef __wasm64__
#error You need to upgrade your Emscripten compiler to support wasm64
#else
#define MAIN_THREAD_EM_ASM_PTR MAIN_THREAD_EM_ASM_INT
#endif
#endif
#include <emscripten.h>
#endif

/* The size of the stack buffer to use for rendering assert messages. */
Expand Down Expand Up @@ -259,34 +251,39 @@ static SDL_assert_state SDLCALL SDL_PromptAssertion(const SDL_assert_data *data,
for (;;) {
SDL_bool okay = SDL_TRUE;
/* *INDENT-OFF* */ /* clang-format off */
char *buf = (char *) MAIN_THREAD_EM_ASM_PTR({
int reply = MAIN_THREAD_EM_ASM_INT({
var str =
UTF8ToString($0) + '\n\n' +
'Abort/Retry/Ignore/AlwaysIgnore? [ariA] :';
var reply = window.prompt(str, "i");
if (reply === null) {
reply = "i";
}
return allocate(intArrayFromString(reply), 'i8', ALLOC_NORMAL);
return reply.length === 1 ? reply.charCodeAt(0) : -1;
}, message);
/* *INDENT-ON* */ /* clang-format on */

if (SDL_strcmp(buf, "a") == 0) {
switch (reply) {
case 'a':
state = SDL_ASSERTION_ABORT;
#if 0 /* (currently) no break functionality on Emscripten */
} else if (SDL_strcmp(buf, "b") == 0) {
case 'b':
state = SDL_ASSERTION_BREAK;
break;
#endif
} else if (SDL_strcmp(buf, "r") == 0) {
case 'r':
state = SDL_ASSERTION_RETRY;
} else if (SDL_strcmp(buf, "i") == 0) {
break;
case 'i':
state = SDL_ASSERTION_IGNORE;
} else if (SDL_strcmp(buf, "A") == 0) {
break;
case 'A':
state = SDL_ASSERTION_ALWAYS_IGNORE;
} else {
break;
default:
okay = SDL_FALSE;
break;
}
free(buf);

if (okay) {
break;
Expand Down
2 changes: 1 addition & 1 deletion src/audio/pipewire/SDL_pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ static void node_event_info(void *object, const struct pw_node_info *info)

/* Need to parse the parameters to get the sample rate */
for (i = 0; i < info->n_params; ++i) {
pw_node_enum_params(node->proxy, 0, info->params[i].id, 0, 0, NULL);
pw_node_enum_params((struct pw_node*)node->proxy, 0, info->params[i].id, 0, 0, NULL);
}

hotplug_core_sync(node);
Expand Down
9 changes: 6 additions & 3 deletions src/core/linux/SDL_udev.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,12 @@ static int device_class(struct udev_device *dev)
}

val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_ACCELEROMETER");
if (SDL_GetHintBoolean(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_TRUE) &&
val && SDL_strcmp(val, "1") == 0) {
devclass |= SDL_UDEV_DEVICE_JOYSTICK;
if (val && SDL_strcmp(val, "1") == 0) {
if (SDL_GetHintBoolean(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_FALSE)) {
devclass |= SDL_UDEV_DEVICE_JOYSTICK;
} else {
devclass |= SDL_UDEV_DEVICE_ACCELEROMETER;
}
}

val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_MOUSE");
Expand Down
6 changes: 2 additions & 4 deletions src/joystick/hidapi/SDL_hidapijoystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,10 +890,8 @@ static SDL_HIDAPI_Device *HIDAPI_AddDevice(const struct SDL_hid_device_info *inf
return NULL;
}
device->magic = &SDL_HIDAPI_device_magic;
device->path = SDL_strdup(info->path);
if (!device->path) {
SDL_free(device);
return NULL;
if (info->path) {
device->path = SDL_strdup(info->path);
}
device->seen = SDL_TRUE;
device->vendor_id = info->vendor_id;
Expand Down
2 changes: 2 additions & 0 deletions src/joystick/windows/SDL_rawinputjoystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,9 +908,11 @@ static void RAWINPUT_AddDevice(HANDLE hDevice)
char *product_string = NULL;
WCHAR string[128];

string[0] = 0;
if (SDL_HidD_GetManufacturerString(hFile, string, sizeof(string))) {
manufacturer_string = WIN_StringToUTF8W(string);
}
string[0] = 0;
if (SDL_HidD_GetProductString(hFile, string, sizeof(string))) {
product_string = WIN_StringToUTF8W(string);
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/windows/version.rc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,32,2,0
PRODUCTVERSION 2,32,2,0
FILEVERSION 2,32,4,0
PRODUCTVERSION 2,32,4,0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x40004L
Expand All @@ -23,12 +23,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "SDL\0"
VALUE "FileVersion", "2, 32, 2, 0\0"
VALUE "FileVersion", "2, 32, 4, 0\0"
VALUE "InternalName", "SDL\0"
VALUE "LegalCopyright", "Copyright (C) 2025 Sam Lantinga\0"
VALUE "OriginalFilename", "SDL2.dll\0"
VALUE "ProductName", "Simple DirectMedia Layer\0"
VALUE "ProductVersion", "2, 32, 2, 0\0"
VALUE "ProductVersion", "2, 32, 4, 0\0"
END
END
BLOCK "VarFileInfo"
Expand Down
12 changes: 5 additions & 7 deletions src/stdlib/SDL_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,12 @@ static size_t SDL_ScanUnsignedLongLongInternal(const char *text, int count, int
negative = *text == '-';
++text;
}
if ((radix == 0 || radix == 16) && *text == '0' && text[1] != '\0') {
if ((radix == 0 || radix == 16) && *text == '0' && (text[1] == 'x' || text[1] == 'X')) {
text += 2;
radix = 16;
} else if (radix == 0 && *text == '0' && (text[1] >= '0' && text[1] <= '9')) {
++text;
if (*text == 'x' || *text == 'X') {
radix = 16;
++text;
} else if (radix == 0) {
radix = 8;
}
radix = 8;
} else if (radix == 0) {
radix = 10;
}
Expand Down