Skip to content

Commit 35d2548

Browse files
committed
Merge tag 'release-2.32.6'
2 parents 181dd2c + 6510d6c commit 35d2548

File tree

13 files changed

+51
-42
lines changed

13 files changed

+51
-42
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 = 4;
64+
private static final int SDL_MICRO_VERSION = 6;
6565
/*
6666
// Display InputType.SOURCE/CLASS of events and devices
6767
//

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub fn build(b: *std.Build) void {
77

88
const lib = b.addLibrary(.{
99
.name = "SDL2",
10-
.version = .{ .major = 2, .minor = 32, .patch = 4 },
10+
.version = .{ .major = 2, .minor = 32, .patch = 6 },
1111
.linkage = if (t.abi.isAndroid()) .dynamic else .static,
1212
.root_module = b.createModule(.{
1313
.target = target,

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.{
22
.name = .SDL,
3-
.version = "2.32.4",
3+
.version = "2.32.6",
44
.fingerprint = 0x7ac4ce41df223a25,
55
.minimum_zig_version = "0.14.0",
66
.dependencies = .{},

include/SDL_cpuinfo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ _m_prefetch(void *__P)
112112
#include <lasxintrin.h>
113113
#define __LASX__
114114
#endif
115-
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
115+
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H) && \
116+
(defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86))
116117
#include <immintrin.h>
117118
#else
118119
#if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H)

include/SDL_surface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,8 +808,8 @@ extern DECLSPEC int SDLCALL SDL_FillRects
808808
*
809809
* This assumes that the source and destination rectangles are the same size.
810810
* If either `srcrect` or `dstrect` are NULL, the entire surface (`src` or
811-
* `dst`) is copied. The final blit rectangles are saved in `srcrect` and
812-
* `dstrect` after all clipping is performed.
811+
* `dst`) is copied. The final blit rectangle is saved in `dstrect` after
812+
* all clipping is performed.
813813
*
814814
* The blit function should not be called on a locked surface.
815815
*

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 4
61+
#define SDL_PATCHLEVEL 6
6262

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

src/events/SDL_events.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ Uint8 SDL_EventState(Uint32 type, int state)
13181318
Uint8 lo = (type & 0xff);
13191319

13201320
if (SDL_disabled_events[hi] &&
1321-
(SDL_disabled_events[hi]->bits[lo / 32] & (1 << (lo & 31)))) {
1321+
(SDL_disabled_events[hi]->bits[lo / 32] & (1U << (lo & 31)))) {
13221322
current_state = SDL_DISABLE;
13231323
} else {
13241324
current_state = SDL_ENABLE;
@@ -1332,11 +1332,11 @@ Uint8 SDL_EventState(Uint32 type, int state)
13321332
}
13331333
/* Out of memory, nothing we can do... */
13341334
if (SDL_disabled_events[hi]) {
1335-
SDL_disabled_events[hi]->bits[lo / 32] |= (1 << (lo & 31));
1335+
SDL_disabled_events[hi]->bits[lo / 32] |= (1U << (lo & 31));
13361336
SDL_FlushEvent(type);
13371337
}
13381338
} else { // state == SDL_ENABLE
1339-
SDL_disabled_events[hi]->bits[lo / 32] &= ~(1 << (lo & 31));
1339+
SDL_disabled_events[hi]->bits[lo / 32] &= ~(1U << (lo & 31));
13401340
}
13411341

13421342
#ifndef SDL_JOYSTICK_DISABLED

src/hidapi/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ case $host in
7979
backend="mac"
8080
os="darwin"
8181
threads="pthreads"
82-
LIBS="${LIBS} -framework IOKit -framework CoreFoundation -framework AppKit"
82+
LIBS="${LIBS} -framework IOKit -framework CoreFoundation"
8383
;;
8484
*-freebsd*)
8585
AC_MSG_RESULT([ (FreeBSD back-end)])

src/hidapi/mac/Makefile-manual

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ COBJS=hid.o
1414
CPPOBJS=../hidtest/hidtest.o
1515
OBJS=$(COBJS) $(CPPOBJS)
1616
CFLAGS+=-I../hidapi -Wall -g -c
17-
LIBS=-framework IOKit -framework CoreFoundation -framework AppKit
17+
LIBS=-framework IOKit -framework CoreFoundation
1818

1919

2020
hidtest: $(OBJS)

src/hidapi/mac/hid.c

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737

3838
#define VALVE_USB_VID 0x28DE
3939

40-
/* As defined in AppKit.h, but we don't need the entire AppKit for a single constant. */
41-
extern const double NSAppKitVersionNumber;
42-
4340
/* Barrier implementation because Mac OSX doesn't have pthread_barrier.
4441
It also doesn't have clock_gettime(). So much for POSIX and SUSv2.
4542
This implementation came from Brent Priddy and was posted on
@@ -134,7 +131,6 @@ struct hid_device_list_node
134131
};
135132

136133
static IOHIDManagerRef hid_mgr = 0x0;
137-
static int is_macos_10_10_or_greater = 0;
138134
static struct hid_device_list_node *device_list = 0x0;
139135

140136
static hid_device *new_hid_device(void)
@@ -489,7 +485,6 @@ static int init_hid_manager(void)
489485
int HID_API_EXPORT hid_init(void)
490486
{
491487
if (!hid_mgr) {
492-
is_macos_10_10_or_greater = (NSAppKitVersionNumber >= 1343); /* NSAppKitVersionNumber10_10 */
493488
return init_hid_manager();
494489
}
495490

@@ -1140,13 +1135,14 @@ int HID_API_EXPORT hid_get_feature_report(hid_device *dev, unsigned char *data,
11401135

11411136
void HID_API_EXPORT hid_close(hid_device *dev)
11421137
{
1138+
int disconnected;
1139+
11431140
if (!dev)
11441141
return;
11451142

1146-
/* Disconnect the report callback before close.
1147-
See comment below.
1148-
*/
1149-
if (is_macos_10_10_or_greater || !dev->disconnected) {
1143+
/* Disconnect the report callback before close. */
1144+
disconnected = dev->disconnected;
1145+
if (!disconnected) {
11501146
IOHIDDeviceRegisterInputReportCallback(
11511147
dev->device_handle, dev->input_report_buf, dev->max_input_report_len,
11521148
NULL, dev);
@@ -1169,14 +1165,8 @@ void HID_API_EXPORT hid_close(hid_device *dev)
11691165

11701166
/* Close the OS handle to the device, but only if it's not
11711167
been unplugged. If it's been unplugged, then calling
1172-
IOHIDDeviceClose() will crash.
1173-
1174-
UPD: The crash part was true in/until some version of macOS.
1175-
Starting with macOS 10.15, there is an opposite effect in some environments:
1176-
crash happenes if IOHIDDeviceClose() is not called.
1177-
Not leaking a resource in all tested environments.
1178-
*/
1179-
if (is_macos_10_10_or_greater || !dev->disconnected) {
1168+
IOHIDDeviceClose() will crash. */
1169+
if (!disconnected) {
11801170
IOHIDDeviceClose(dev->device_handle, kIOHIDOptionsTypeNone);
11811171
}
11821172

0 commit comments

Comments
 (0)