Commit 814285d6e30d1a84e6850038bc1fcc6b67ef4f35

Sam Lantinga 2021-06-23T09:19:02

Workaround for crash on Apple Mac M1 hardware

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/hidapi/mac/hid.c b/src/hidapi/mac/hid.c
index 26eab23..de97b04 100644
--- a/src/hidapi/mac/hid.c
+++ b/src/hidapi/mac/hid.c
@@ -326,7 +326,10 @@ static int get_string_property_utf8(IOHIDDeviceRef device, CFStringRef prop, cha
 
 static int get_serial_number(IOHIDDeviceRef device, wchar_t *buf, size_t len)
 {
-	return get_string_property(device, CFSTR(kIOHIDSerialNumberKey), buf, len);
+	// This crashes on M1 Macs, tracked by radar bug 79667729
+	//return get_string_property(device, CFSTR(kIOHIDSerialNumberKey), buf, len);
+	buf[0] = 0;
+	return 0;
 }
 
 static int get_manufacturer_string(IOHIDDeviceRef device, wchar_t *buf, size_t len)