瀏覽代碼

Reenable getting the serial number on macOS

We filter now on game controllers, so we shouldn't hit the crash bug on random devices that this was working around.
Sam Lantinga 4 年之前
父節點
當前提交
14db417e12
共有 1 個文件被更改,包括 1 次插入4 次删除
  1. 1 4
      src/hidapi/mac/hid.c

+ 1 - 4
src/hidapi/mac/hid.c

@@ -326,10 +326,7 @@ static int get_string_property_utf8(IOHIDDeviceRef device, CFStringRef prop, cha
 
 
 static int get_serial_number(IOHIDDeviceRef device, wchar_t *buf, size_t len)
 static int get_serial_number(IOHIDDeviceRef device, wchar_t *buf, size_t 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;
+	return get_string_property(device, CFSTR(kIOHIDSerialNumberKey), buf, len);
 }
 }
 
 
 static int get_manufacturer_string(IOHIDDeviceRef device, wchar_t *buf, size_t len)
 static int get_manufacturer_string(IOHIDDeviceRef device, wchar_t *buf, size_t len)