usb 2.12.1 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +11 -1
  3. package/dist/index.js +6 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/usb/bindings.d.ts +0 -1
  6. package/dist/usb/bindings.js +1 -1
  7. package/dist/usb/bindings.js.map +1 -1
  8. package/dist/usb/capability.d.ts +0 -1
  9. package/dist/usb/capability.js.map +1 -1
  10. package/dist/usb/descriptors.d.ts +0 -1
  11. package/dist/usb/device.d.ts +0 -1
  12. package/dist/usb/device.js.map +1 -1
  13. package/dist/usb/endpoint.d.ts +0 -1
  14. package/dist/usb/endpoint.js +2 -2
  15. package/dist/usb/endpoint.js.map +1 -1
  16. package/dist/usb/index.js.map +1 -1
  17. package/dist/usb/interface.js +2 -2
  18. package/dist/usb/interface.js.map +1 -1
  19. package/dist/webusb/index.d.ts +1 -3
  20. package/dist/webusb/index.js.map +1 -1
  21. package/dist/webusb/webusb-device.d.ts +0 -1
  22. package/dist/webusb/webusb-device.js +10 -10
  23. package/dist/webusb/webusb-device.js.map +1 -1
  24. package/libusb/.codespellrc +3 -0
  25. package/libusb/.private/appveyor_build.sh +5 -1
  26. package/libusb/.private/ci-build.sh +26 -1
  27. package/libusb/.private/ci-container-build.sh +2 -5
  28. package/libusb/.private/wbs.txt +5 -8
  29. package/libusb/AUTHORS +22 -0
  30. package/libusb/ChangeLog +19 -2
  31. package/libusb/HACKING +25 -0
  32. package/libusb/INSTALL_WIN.txt +11 -10
  33. package/libusb/NEWS +2 -2
  34. package/libusb/README +3 -2
  35. package/libusb/README.git +1 -1
  36. package/libusb/Xcode/common.xcconfig +8 -1
  37. package/libusb/Xcode/config.h +0 -6
  38. package/libusb/Xcode/debug.xcconfig +4 -1
  39. package/libusb/Xcode/libusb.xcconfig +1 -1
  40. package/libusb/Xcode/libusb.xcodeproj/project.pbxproj +60 -30
  41. package/libusb/Xcode/libusb_debug.xcconfig +1 -1
  42. package/libusb/Xcode/libusb_release.xcconfig +1 -1
  43. package/libusb/Xcode/release.xcconfig +1 -1
  44. package/libusb/appveyor.yml +33 -9
  45. package/libusb/configure.ac +68 -37
  46. package/libusb/examples/dpfp.c +2 -2
  47. package/libusb/examples/fxload.c +2 -2
  48. package/libusb/examples/hotplugtest.c +28 -13
  49. package/libusb/examples/listdevs.c +1 -1
  50. package/libusb/examples/sam3u_benchmark.c +1 -1
  51. package/libusb/examples/testlibusb.c +1 -1
  52. package/libusb/examples/xusb.c +74 -19
  53. package/libusb/libusb/Makefile.am +11 -1
  54. package/libusb/libusb/core.c +364 -186
  55. package/libusb/libusb/descriptor.c +276 -16
  56. package/libusb/libusb/hotplug.c +5 -4
  57. package/libusb/libusb/io.c +72 -61
  58. package/libusb/libusb/libusb-1.0.def +14 -1
  59. package/libusb/libusb/libusb.h +245 -76
  60. package/libusb/libusb/libusbi.h +35 -13
  61. package/libusb/libusb/os/darwin_usb.c +542 -279
  62. package/libusb/libusb/os/darwin_usb.h +44 -115
  63. package/libusb/libusb/os/emscripten_webusb.cpp +870 -0
  64. package/libusb/libusb/os/events_posix.c +40 -0
  65. package/libusb/libusb/os/events_posix.h +3 -0
  66. package/libusb/libusb/os/linux_usbfs.c +27 -16
  67. package/libusb/libusb/os/netbsd_usb.c +36 -36
  68. package/libusb/libusb/os/openbsd_usb.c +34 -34
  69. package/libusb/libusb/os/sunos_usb.c +25 -15
  70. package/libusb/libusb/os/threads_posix.c +1 -5
  71. package/libusb/libusb/os/windows_common.c +13 -5
  72. package/libusb/libusb/os/windows_common.h +8 -0
  73. package/libusb/libusb/os/windows_winusb.c +366 -174
  74. package/libusb/libusb/os/windows_winusb.h +13 -9
  75. package/libusb/libusb/strerror.c +5 -5
  76. package/libusb/libusb/sync.c +24 -19
  77. package/libusb/libusb/version.h +1 -1
  78. package/libusb/libusb/version_nano.h +1 -1
  79. package/libusb/msvc/Base.props +60 -0
  80. package/libusb/msvc/Configuration.Application.props +7 -0
  81. package/libusb/msvc/Configuration.Base.props +47 -0
  82. package/libusb/msvc/Configuration.DynamicLibrary.props +21 -0
  83. package/libusb/msvc/Configuration.StaticLibrary.props +7 -0
  84. package/libusb/msvc/ProjectConfigurations.Base.props +69 -0
  85. package/libusb/msvc/build_all.ps1 +17 -0
  86. package/libusb/msvc/config.h +2 -2
  87. package/libusb/msvc/dpfp.vcxproj +33 -0
  88. package/libusb/msvc/dpfp_threaded.vcxproj +38 -0
  89. package/libusb/msvc/fxload.vcxproj +46 -0
  90. package/libusb/msvc/getopt.vcxproj +33 -0
  91. package/libusb/msvc/hotplugtest.vcxproj +32 -0
  92. package/libusb/msvc/init_context.vcxproj +35 -0
  93. package/libusb/msvc/libusb.sln +542 -0
  94. package/libusb/msvc/libusb_dll.vcxproj +61 -0
  95. package/libusb/msvc/libusb_static.vcxproj +49 -0
  96. package/libusb/msvc/listdevs.vcxproj +32 -0
  97. package/libusb/msvc/sam3u_benchmark.vcxproj +33 -0
  98. package/libusb/msvc/set_option.vcxproj +35 -0
  99. package/libusb/msvc/stress.vcxproj +35 -0
  100. package/libusb/msvc/stress_mt.vcxproj +33 -0
  101. package/libusb/msvc/testlibusb.vcxproj +32 -0
  102. package/libusb/msvc/xusb.vcxproj +38 -0
  103. package/libusb/tests/Makefile.am +25 -3
  104. package/libusb/tests/init_context.c +153 -0
  105. package/libusb/tests/macos.c +130 -0
  106. package/libusb/tests/set_option.c +253 -0
  107. package/libusb/tests/stress.c +17 -14
  108. package/libusb/tests/stress_mt.c +265 -0
  109. package/libusb/tests/testlib.c +1 -1
  110. package/libusb/tests/umockdev.c +9 -9
  111. package/libusb/tests/webusb-test-shim/index.js +12 -0
  112. package/libusb/tests/webusb-test-shim/package-lock.json +50 -0
  113. package/libusb/tests/webusb-test-shim/package.json +10 -0
  114. package/package.json +8 -8
  115. package/prebuilds/android-arm/node.napi.armv7.node +0 -0
  116. package/prebuilds/android-arm64/node.napi.armv8.node +0 -0
  117. package/prebuilds/darwin-x64+arm64/node.napi.node +0 -0
  118. package/prebuilds/linux-arm/node.napi.armv6.node +0 -0
  119. package/prebuilds/linux-arm/node.napi.armv7.node +0 -0
  120. package/prebuilds/linux-arm64/node.napi.armv8.node +0 -0
  121. package/prebuilds/linux-ia32/node.napi.node +0 -0
  122. package/prebuilds/linux-x64/node.napi.glibc.node +0 -0
  123. package/prebuilds/linux-x64/node.napi.musl.node +0 -0
  124. package/prebuilds/win32-arm64/node.napi.node +0 -0
  125. package/prebuilds/win32-ia32/node.napi.node +0 -0
  126. package/prebuilds/win32-x64/node.napi.node +0 -0
  127. package/src/device.cc +16 -6
  128. package/src/transfer.cc +1 -1
  129. package/libusb/msvc/dpfp_2013.vcxproj +0 -87
  130. package/libusb/msvc/dpfp_2013.vcxproj.filters +0 -26
  131. package/libusb/msvc/dpfp_2015.vcxproj +0 -87
  132. package/libusb/msvc/dpfp_2015.vcxproj.filters +0 -26
  133. package/libusb/msvc/dpfp_2017.vcxproj +0 -106
  134. package/libusb/msvc/dpfp_2017.vcxproj.filters +0 -26
  135. package/libusb/msvc/dpfp_2019.vcxproj +0 -106
  136. package/libusb/msvc/dpfp_2019.vcxproj.filters +0 -26
  137. package/libusb/msvc/dpfp_threaded_2013.vcxproj +0 -87
  138. package/libusb/msvc/dpfp_threaded_2013.vcxproj.filters +0 -26
  139. package/libusb/msvc/dpfp_threaded_2015.vcxproj +0 -87
  140. package/libusb/msvc/dpfp_threaded_2015.vcxproj.filters +0 -26
  141. package/libusb/msvc/dpfp_threaded_2017.vcxproj +0 -106
  142. package/libusb/msvc/dpfp_threaded_2017.vcxproj.filters +0 -26
  143. package/libusb/msvc/dpfp_threaded_2019.vcxproj +0 -106
  144. package/libusb/msvc/dpfp_threaded_2019.vcxproj.filters +0 -26
  145. package/libusb/msvc/fxload_2013.vcxproj +0 -94
  146. package/libusb/msvc/fxload_2013.vcxproj.filters +0 -35
  147. package/libusb/msvc/fxload_2015.vcxproj +0 -94
  148. package/libusb/msvc/fxload_2015.vcxproj.filters +0 -35
  149. package/libusb/msvc/fxload_2017.vcxproj +0 -113
  150. package/libusb/msvc/fxload_2017.vcxproj.filters +0 -35
  151. package/libusb/msvc/fxload_2019.vcxproj +0 -113
  152. package/libusb/msvc/fxload_2019.vcxproj.filters +0 -35
  153. package/libusb/msvc/getopt_2013.vcxproj +0 -72
  154. package/libusb/msvc/getopt_2013.vcxproj.filters +0 -26
  155. package/libusb/msvc/getopt_2015.vcxproj +0 -73
  156. package/libusb/msvc/getopt_2015.vcxproj.filters +0 -26
  157. package/libusb/msvc/getopt_2017.vcxproj +0 -92
  158. package/libusb/msvc/getopt_2017.vcxproj.filters +0 -26
  159. package/libusb/msvc/getopt_2019.vcxproj +0 -92
  160. package/libusb/msvc/getopt_2019.vcxproj.filters +0 -26
  161. package/libusb/msvc/hotplugtest_2013.vcxproj +0 -86
  162. package/libusb/msvc/hotplugtest_2013.vcxproj.filters +0 -23
  163. package/libusb/msvc/hotplugtest_2015.vcxproj +0 -86
  164. package/libusb/msvc/hotplugtest_2015.vcxproj.filters +0 -23
  165. package/libusb/msvc/hotplugtest_2017.vcxproj +0 -105
  166. package/libusb/msvc/hotplugtest_2017.vcxproj.filters +0 -23
  167. package/libusb/msvc/hotplugtest_2019.vcxproj +0 -105
  168. package/libusb/msvc/hotplugtest_2019.vcxproj.filters +0 -23
  169. package/libusb/msvc/libusb_2013.sln +0 -137
  170. package/libusb/msvc/libusb_2015.sln +0 -137
  171. package/libusb/msvc/libusb_2017.sln +0 -240
  172. package/libusb/msvc/libusb_2019.sln +0 -240
  173. package/libusb/msvc/libusb_dll_2013.vcxproj +0 -104
  174. package/libusb/msvc/libusb_dll_2013.vcxproj.filters +0 -94
  175. package/libusb/msvc/libusb_dll_2015.vcxproj +0 -105
  176. package/libusb/msvc/libusb_dll_2015.vcxproj.filters +0 -94
  177. package/libusb/msvc/libusb_dll_2017.vcxproj +0 -124
  178. package/libusb/msvc/libusb_dll_2017.vcxproj.filters +0 -94
  179. package/libusb/msvc/libusb_dll_2019.vcxproj +0 -124
  180. package/libusb/msvc/libusb_dll_2019.vcxproj.filters +0 -94
  181. package/libusb/msvc/libusb_static_2013.vcxproj +0 -94
  182. package/libusb/msvc/libusb_static_2013.vcxproj.filters +0 -80
  183. package/libusb/msvc/libusb_static_2015.vcxproj +0 -95
  184. package/libusb/msvc/libusb_static_2015.vcxproj.filters +0 -80
  185. package/libusb/msvc/libusb_static_2017.vcxproj +0 -114
  186. package/libusb/msvc/libusb_static_2017.vcxproj.filters +0 -80
  187. package/libusb/msvc/libusb_static_2019.vcxproj +0 -114
  188. package/libusb/msvc/libusb_static_2019.vcxproj.filters +0 -80
  189. package/libusb/msvc/listdevs_2013.vcxproj +0 -86
  190. package/libusb/msvc/listdevs_2013.vcxproj.filters +0 -23
  191. package/libusb/msvc/listdevs_2015.vcxproj +0 -86
  192. package/libusb/msvc/listdevs_2015.vcxproj.filters +0 -23
  193. package/libusb/msvc/listdevs_2017.vcxproj +0 -105
  194. package/libusb/msvc/listdevs_2017.vcxproj.filters +0 -23
  195. package/libusb/msvc/listdevs_2019.vcxproj +0 -105
  196. package/libusb/msvc/listdevs_2019.vcxproj.filters +0 -23
  197. package/libusb/msvc/sam3u_benchmark_2013.vcxproj +0 -87
  198. package/libusb/msvc/sam3u_benchmark_2013.vcxproj.filters +0 -26
  199. package/libusb/msvc/sam3u_benchmark_2015.vcxproj +0 -87
  200. package/libusb/msvc/sam3u_benchmark_2015.vcxproj.filters +0 -26
  201. package/libusb/msvc/sam3u_benchmark_2017.vcxproj +0 -106
  202. package/libusb/msvc/sam3u_benchmark_2017.vcxproj.filters +0 -26
  203. package/libusb/msvc/sam3u_benchmark_2019.vcxproj +0 -106
  204. package/libusb/msvc/sam3u_benchmark_2019.vcxproj.filters +0 -26
  205. package/libusb/msvc/stress_2013.vcxproj +0 -89
  206. package/libusb/msvc/stress_2013.vcxproj.filters +0 -32
  207. package/libusb/msvc/stress_2015.vcxproj +0 -89
  208. package/libusb/msvc/stress_2015.vcxproj.filters +0 -32
  209. package/libusb/msvc/stress_2017.vcxproj +0 -108
  210. package/libusb/msvc/stress_2017.vcxproj.filters +0 -32
  211. package/libusb/msvc/stress_2019.vcxproj +0 -108
  212. package/libusb/msvc/stress_2019.vcxproj.filters +0 -32
  213. package/libusb/msvc/testlibusb_2013.vcxproj +0 -86
  214. package/libusb/msvc/testlibusb_2013.vcxproj.filters +0 -23
  215. package/libusb/msvc/testlibusb_2015.vcxproj +0 -86
  216. package/libusb/msvc/testlibusb_2015.vcxproj.filters +0 -23
  217. package/libusb/msvc/testlibusb_2017.vcxproj +0 -105
  218. package/libusb/msvc/testlibusb_2017.vcxproj.filters +0 -23
  219. package/libusb/msvc/testlibusb_2019.vcxproj +0 -105
  220. package/libusb/msvc/testlibusb_2019.vcxproj.filters +0 -23
  221. package/libusb/msvc/xusb_2013.vcxproj +0 -86
  222. package/libusb/msvc/xusb_2013.vcxproj.filters +0 -23
  223. package/libusb/msvc/xusb_2015.vcxproj +0 -86
  224. package/libusb/msvc/xusb_2015.vcxproj.filters +0 -23
  225. package/libusb/msvc/xusb_2017.vcxproj +0 -105
  226. package/libusb/msvc/xusb_2017.vcxproj.filters +0 -23
  227. package/libusb/msvc/xusb_2019.vcxproj +0 -105
  228. package/libusb/msvc/xusb_2019.vcxproj.filters +0 -23
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * darwin backend for libusb 1.0
3
- * Copyright © 2008-2019 Nathan Hjelm <hjelmn@users.sourceforge.net>
4
- * Copyright © 2019 Google LLC. All rights reserved.
3
+ * Copyright © 2008-2023 Nathan Hjelm <hjelmn@users.sourceforge.net>
4
+ * Copyright © 2019-2023 Google LLC. All rights reserved.
5
5
  *
6
6
  * This library is free software; you can redistribute it and/or
7
7
  * modify it under the terms of the GNU Lesser General Public
@@ -36,117 +36,48 @@
36
36
 
37
37
  /* IOUSBInterfaceInferface */
38
38
 
39
- /* New in OS 10.12.0. */
40
- #if defined (kIOUSBInterfaceInterfaceID800)
41
-
42
- #define usb_interface_t IOUSBInterfaceInterface800
43
- #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID800
44
- #define InterfaceVersion 800
45
-
46
- /* New in OS 10.10.0. */
47
- #elif defined (kIOUSBInterfaceInterfaceID700)
48
-
49
- #define usb_interface_t IOUSBInterfaceInterface700
50
- #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID700
51
- #define InterfaceVersion 700
52
-
53
- /* New in OS 10.9.0. */
54
- #elif defined (kIOUSBInterfaceInterfaceID650)
55
-
56
- #define usb_interface_t IOUSBInterfaceInterface650
57
- #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID650
58
- #define InterfaceVersion 650
59
-
60
- /* New in OS 10.8.2 but can't test deployment target to that granularity, so round up. */
61
- #elif defined (kIOUSBInterfaceInterfaceID550)
62
-
63
- #define usb_interface_t IOUSBInterfaceInterface550
64
- #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID550
65
- #define InterfaceVersion 550
66
-
67
- /* New in OS 10.7.3 but can't test deployment target to that granularity, so round up. */
68
- #elif defined (kIOUSBInterfaceInterfaceID500)
69
-
70
- #define usb_interface_t IOUSBInterfaceInterface500
71
- #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID500
72
- #define InterfaceVersion 500
73
-
74
- /* New in OS 10.5.0. */
75
- #elif defined (kIOUSBInterfaceInterfaceID300)
76
-
77
- #define usb_interface_t IOUSBInterfaceInterface300
78
- #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID300
79
- #define InterfaceVersion 300
80
-
81
- /* New in OS 10.4.5 (or 10.4.6?) but can't test deployment target to that granularity, so round up. */
82
- #elif defined (kIOUSBInterfaceInterfaceID245)
83
-
84
- #define usb_interface_t IOUSBInterfaceInterface245
85
- #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID245
86
- #define InterfaceVersion 245
87
-
88
- /* New in OS 10.4.0. */
89
- #elif defined (kIOUSBInterfaceInterfaceID220)
90
-
91
- #define usb_interface_t IOUSBInterfaceInterface220
92
- #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID220
93
- #define InterfaceVersion 220
94
-
39
+ #if defined(kIOUSBInterfaceInterfaceID800)
40
+ #define MAX_INTERFACE_VERSION 800
41
+ #elif defined(kIOUSBInterfaceInterfaceID700)
42
+ #define MAX_INTERFACE_VERSION 700
43
+ #elif defined(kIOUSBInterfaceInterfaceID650)
44
+ #define MAX_INTERFACE_VERSION 650
45
+ #elif defined(kIOUSBInterfaceInterfaceID550)
46
+ #define MAX_INTERFACE_VERSION 550
47
+ #elif defined(kIOUSBInterfaceInterfaceID245)
48
+ #define MAX_INTERFACE_VERSION 245
95
49
  #else
96
-
97
- #error "IOUSBFamily is too old. Please upgrade your SDK and/or deployment target"
98
-
50
+ #define MAX_INTERFACE_VERSION 220
99
51
  #endif
100
52
 
101
- /* IOUSBDeviceInterface */
102
-
103
- /* New in OS 10.9.0. */
104
- #if defined (kIOUSBDeviceInterfaceID650)
105
-
106
- #define usb_device_t IOUSBDeviceInterface650
107
- #define DeviceInterfaceID kIOUSBDeviceInterfaceID650
108
- #define DeviceVersion 650
109
-
110
- /* New in OS 10.7.3 but can't test deployment target to that granularity, so round up. */
111
- #elif defined (kIOUSBDeviceInterfaceID500)
112
-
113
- #define usb_device_t IOUSBDeviceInterface500
114
- #define DeviceInterfaceID kIOUSBDeviceInterfaceID500
115
- #define DeviceVersion 500
116
-
117
- /* New in OS 10.5.4 but can't test deployment target to that granularity, so round up. */
118
- #elif defined (kIOUSBDeviceInterfaceID320)
119
-
120
- #define usb_device_t IOUSBDeviceInterface320
121
- #define DeviceInterfaceID kIOUSBDeviceInterfaceID320
122
- #define DeviceVersion 320
123
-
124
- /* New in OS 10.5.0. */
125
- #elif defined (kIOUSBDeviceInterfaceID300)
126
-
127
- #define usb_device_t IOUSBDeviceInterface300
128
- #define DeviceInterfaceID kIOUSBDeviceInterfaceID300
129
- #define DeviceVersion 300
53
+ /* set to the minimum version and casted up as needed. */
54
+ typedef IOUSBInterfaceInterface220 **usb_interface_t;
130
55
 
131
- /* New in OS 10.4.5 (or 10.4.6?) but can't test deployment target to that granularity, so round up. */
132
- #elif defined (kIOUSBDeviceInterfaceID245)
56
+ #define IOINTERFACE0(darwin_interface, version) ((IOUSBInterfaceInterface ## version **) (darwin_interface)->interface)
57
+ #define IOINTERFACE_V(darwin_interface, version) IOINTERFACE0(darwin_interface, version)
58
+ #define IOINTERFACE(darwin_interface) ((darwin_interface)->interface)
133
59
 
134
- #define usb_device_t IOUSBDeviceInterface245
135
- #define DeviceInterfaceID kIOUSBDeviceInterfaceID245
136
- #define DeviceVersion 245
137
-
138
- /* New in OS 10.2.3 but can't test deployment target to that granularity, so round up. */
139
- #elif defined (kIOUSBDeviceInterfaceID197)
140
-
141
- #define usb_device_t IOUSBDeviceInterface197
142
- #define DeviceInterfaceID kIOUSBDeviceInterfaceID197
143
- #define DeviceVersion 197
60
+ /* IOUSBDeviceInterface */
144
61
 
62
+ #if defined(kIOUSBDeviceInterfaceID650)
63
+ #define MAX_DEVICE_VERSION 650
64
+ #elif defined(kIOUSBDeviceInterfaceID500)
65
+ #define MAX_DEVICE_VERSION 500
66
+ #elif defined(kIOUSBDeviceInterfaceID320)
67
+ #define MAX_DEVICE_VERSION 320
68
+ #elif defined(kIOUSBDeviceInterfaceID300)
69
+ #define MAX_DEVICE_VERSION 300
70
+ #elif defined(kIOUSBDeviceInterfaceID245)
71
+ #define MAX_DEVICE_VERSION 245
145
72
  #else
73
+ #define MAX_DEVICE_VERSION 197
74
+ #endif
146
75
 
147
- #error "IOUSBFamily is too old. Please upgrade your SDK and/or deployment target"
76
+ /* set to the minimum version and casted up as needed */
77
+ typedef IOUSBDeviceInterface197 **usb_device_t;
148
78
 
149
- #endif
79
+ #define IODEVICE0(darwin_device, version) ((IOUSBDeviceInterface ## version **)(darwin_device))
80
+ #define IODEVICE_V(darwin_device, version) IODEVICE0(darwin_device, version)
150
81
 
151
82
  #if !defined(kIOUSBHostInterfaceClassName)
152
83
  #define kIOUSBHostInterfaceClassName "IOUSBHostInterface"
@@ -160,15 +91,13 @@
160
91
  #define IO_OBJECT_NULL ((io_object_t) 0)
161
92
  #endif
162
93
 
163
- /* Testing availability */
164
- #ifndef __has_builtin
165
- #define __has_builtin(x) 0 // Compatibility with non-clang compilers.
166
- #endif
167
- #if __has_builtin(__builtin_available)
168
- #define HAS_CAPTURE_DEVICE() __builtin_available(macOS 10.10, *)
169
- #else
170
- #define HAS_CAPTURE_DEVICE() 0
171
- #endif
94
+ /* returns the current macOS version in a format similar to the
95
+ * MAC_OS_X_VERSION_MIN_REQUIRED macro.
96
+ * Examples:
97
+ * 10.1.5 -> 100105
98
+ * 13.3.0 -> 130300
99
+ */
100
+ uint32_t get_running_version(void);
172
101
 
173
102
  typedef IOCFPlugInInterface *io_cf_plugin_ref_t;
174
103
  typedef IONotificationPortRef io_notification_port_t;
@@ -182,7 +111,7 @@ struct darwin_cached_device {
182
111
  UInt64 session;
183
112
  USBDeviceAddress address;
184
113
  char sys_path[21];
185
- usb_device_t **device;
114
+ usb_device_t device;
186
115
  io_service_t service;
187
116
  int open_count;
188
117
  UInt8 first_config, active_config, port;
@@ -201,7 +130,7 @@ struct darwin_device_handle_priv {
201
130
  CFRunLoopSourceRef cfSource;
202
131
 
203
132
  struct darwin_interface {
204
- usb_interface_t **interface;
133
+ usb_interface_t interface;
205
134
  uint8_t num_endpoints;
206
135
  CFRunLoopSourceRef cfSource;
207
136
  uint64_t frames[256];