Pete Batard | f17d190 | 2012-09-25 00:35:32 +0100 | [diff] [blame] | 1 | For detailed information about the changes below, please see the git log or |
hjelmn@cs.unm.edu | 1eff220 | 2014-01-08 23:50:34 +0000 | [diff] [blame] | 2 | visit: http://log.libusb.info |
Pete Batard | f17d190 | 2012-09-25 00:35:32 +0100 | [diff] [blame] | 3 | |
Chris Dickens | c6a35c5 | 2020-12-10 10:53:59 -0800 | [diff] [blame] | 4 | 2020-12-09: v1.0.24 |
| 5 | * Add new platform abstraction (#252) |
| 6 | * Add Null POSIX backend |
| 7 | * Add support for eventfd |
| 8 | * Add support for thread IDs on Haiku, NetBSD and Solaris |
| 9 | * New API libusb_hotplug_get_user_data() |
| 10 | * Darwin (macOS): Fix race condition that results in segmentation fault (#701) |
| 11 | * Darwin (macOS): Fix stale descriptor information post reset (#733) |
| 12 | * Darwin (macOS): use IOUSBDevice as darwin_device_class explicitly (#693) |
| 13 | * Linux: Drop support for kernel older than 2.6.32 |
| 14 | * Linux: Provide an event thread name (#689) |
Chris Dickens | 369af14 | 2020-12-13 15:46:27 -0800 | [diff] [blame] | 15 | * Linux: Wait until all URBs have been reaped before freeing them (#607) |
Chris Dickens | c6a35c5 | 2020-12-10 10:53:59 -0800 | [diff] [blame] | 16 | * NetBSD: Recognize device timeouts (#710) |
| 17 | * OpenBSD: Allow opening ugen devices multiple times (#763) |
| 18 | * OpenBSD: Support libusb_get_port_number() (#764) |
| 19 | * SunOS: Fix a memory leak (#756) |
| 20 | * SunOS: Various fixes (#627, #628, #629) |
| 21 | * Windows: Add Visual Studio 2019 support |
| 22 | * Windows: Drop support for WinCE and Visual Studio older than 2013 |
| 23 | * Windows: Drop support for Windows XP |
| 24 | * Windows: Support building all examples using Visual Studio (#151) |
| 25 | * Documentation fixes and improvements |
| 26 | * Various other bug fixes and improvements |
| 27 | |
Nathan Hjelm | e782eeb | 2019-08-28 13:56:18 -0700 | [diff] [blame] | 28 | 2019-08-28: v1.0.23 |
Nathan Hjelm | 15239f6 | 2018-12-05 10:36:20 -0700 | [diff] [blame] | 29 | * Add German translation (#446) |
| 30 | * Add Hungarian translation (#493) |
Nathan Hjelm | acaa806 | 2019-04-05 12:15:48 -0600 | [diff] [blame] | 31 | * Android: Improved support for Android |
Nathan Hjelm | a5990ab | 2019-08-09 09:26:41 -0700 | [diff] [blame] | 32 | * BSD: Remove infinite recursion in OpenBSD backend |
Nathan Hjelm | 15239f6 | 2018-12-05 10:36:20 -0700 | [diff] [blame] | 33 | * configure.ac: Fix detection of clock_gettime library (#439) |
Nathan Hjelm | 4b94eed | 2019-08-14 16:20:57 -0700 | [diff] [blame] | 34 | * Core: abandon synchronous transfers when device closure is detected. |
| 35 | * Core: fix error in handling the removal of file descriptors while handling |
| 36 | events. |
Nathan Hjelm | 15239f6 | 2018-12-05 10:36:20 -0700 | [diff] [blame] | 37 | * Darwin(macOS): Switch from using ResetDevice to USBDeviceReEnumerate (#455) |
| 38 | * Darwin(macOS): Remove code that changed the device class used (#428) |
Nathan Hjelm | acaa806 | 2019-04-05 12:15:48 -0600 | [diff] [blame] | 39 | * Darwin(macOS): Reduce hotplug timeout to 1ms (from 5s) |
Nathan Hjelm | 15239f6 | 2018-12-05 10:36:20 -0700 | [diff] [blame] | 40 | * New API libusb_set_log_cb() to redirect global and per context log |
| 41 | messages to the provided log handling function |
Nathan Hjelm | acaa806 | 2019-04-05 12:15:48 -0600 | [diff] [blame] | 42 | * New API libusb_wrap_sys_device to allow the user to specify the |
| 43 | usb device to use. |
Nathan Hjelm | 15239f6 | 2018-12-05 10:36:20 -0700 | [diff] [blame] | 44 | * Solaris: Break infinite recursion in backend clock_gettime |
| 45 | * Solaris: Enable timerfd on sunos when available |
Nathan Hjelm | acaa806 | 2019-04-05 12:15:48 -0600 | [diff] [blame] | 46 | * Windows: Add support for isochronous transfers with WinUSB |
Nathan Hjelm | 15239f6 | 2018-12-05 10:36:20 -0700 | [diff] [blame] | 47 | * Various other bug fixes and improvements |
| 48 | |
Chris Dickens | c6a35c5 | 2020-12-10 10:53:59 -0800 | [diff] [blame] | 49 | 2018-03-24: v1.0.22 |
Chris Dickens | 84209b4 | 2018-01-08 23:08:47 -0800 | [diff] [blame] | 50 | * New libusb_set_option() API |
| 51 | * Fix transfer timeout not being cleared upon resubmission |
| 52 | * Report super speed plus devices on modern Linux and macOS |
Chris Dickens | 8ddd8d9 | 2018-01-27 17:29:46 -0800 | [diff] [blame] | 53 | * Darwin: Improve support for macOS Sierra and High Sierra |
Chris Dickens | 84209b4 | 2018-01-08 23:08:47 -0800 | [diff] [blame] | 54 | * Darwin: SDK fixes and improvements |
| 55 | * Linux: Let initialization succeed when no devices are present |
| 56 | * Linux: Mark internal file descriptors with CLOEXEC flag |
| 57 | * Solaris: Add support for attach/detach kernel driver |
| 58 | * Windows: Add dynamic UsbDk backend selection |
| 59 | * Windows: Add isochronous transfer support via libusbK |
| 60 | * Windows: Add Visual Studio 2017 support |
| 61 | * Windows: Fix enumeration problems on Windows 8 and later |
| 62 | * Windows: Major rework of poll() emulation |
| 63 | * Windows: Numerous HID API fixes |
| 64 | * Windows: Support cancelation of individual transfers (Vista and later) |
| 65 | * Various other bug fixes and improvements |
| 66 | |
Chris Dickens | c6a35c5 | 2020-12-10 10:53:59 -0800 | [diff] [blame] | 67 | 2016-10-01: v1.0.21 |
Nathan Hjelm | e5b09f3 | 2016-08-21 20:32:39 -0600 | [diff] [blame] | 68 | * Core: Refactor code related to transfer flags and timeout handling |
Nathan Hjelm | 7ce85c4 | 2016-07-21 23:12:56 -0600 | [diff] [blame] | 69 | * Darwin: Ignore root hub simulation devices |
| 70 | * Darwin: Improved support for OS X El Capitan |
Nathan Hjelm | 7f5f86f | 2016-09-12 21:42:23 -0600 | [diff] [blame] | 71 | * Darwin: Work around devices with buggy endpoint descriptors |
| 72 | * Darwin: Do not use objc_registerThreadWithCollector after its deprecation |
| 73 | * Darwin: Use C11 atomics on 10.12+ as the OS atomics are now deprecated |
Nathan Hjelm | 6976733 | 2016-07-22 06:38:09 -0600 | [diff] [blame] | 74 | * Linux: Support preallocating kernel memory for zerocopy USB |
Nathan Hjelm | e5b09f3 | 2016-08-21 20:32:39 -0600 | [diff] [blame] | 75 | * Linux: Deal with receiving POLLERR before all transfers have completed |
Nathan Hjelm | bb014d8 | 2016-07-24 20:01:15 -0600 | [diff] [blame] | 76 | * Solaris: Add solaris backend |
Nathan Hjelm | 7ce85c4 | 2016-07-21 23:12:56 -0600 | [diff] [blame] | 77 | * Windows: Add Visual Studio 2015 support |
Nathan Hjelm | 73d15d1 | 2016-09-14 12:32:54 -0600 | [diff] [blame] | 78 | * Windows: Add usbdk backend |
Nathan Hjelm | e5b09f3 | 2016-08-21 20:32:39 -0600 | [diff] [blame] | 79 | * Prevent attempts to recursively handle events |
Nathan Hjelm | 7ce85c4 | 2016-07-21 23:12:56 -0600 | [diff] [blame] | 80 | * Fix race condition in handle_timeout() |
| 81 | * Allow transferred argument to be optional in bulk APIs |
| 82 | * Various other bug fixes and improvements |
| 83 | |
Chris Dickens | b5991a9 | 2015-09-13 17:37:12 -0700 | [diff] [blame] | 84 | 2015-09-13: v1.0.20 |
Chris Dickens | d73bc72 | 2015-07-29 01:06:37 -0700 | [diff] [blame] | 85 | * Add Haiku support |
| 86 | * Fix multiple memory and resource leaks (#16, #52, #76, #81) |
| 87 | * Fix possible deadlock when executing transfer callback |
| 88 | * New libusb_free_pollfds() API |
| 89 | * Darwin: Fix devices not being detected on OS X 10.8 (#48) |
| 90 | * Linux: Allow larger isochronous transfer submission (#23) |
| 91 | * Windows: Fix broken builds Cygwin/MinGW builds and compiler warnings |
| 92 | * Windows: Fix broken bus number lookup |
| 93 | * Windows: Improve submission of control requests for composite devices |
Chris Dickens | 8f2d5bb | 2015-09-02 19:54:44 -0700 | [diff] [blame] | 94 | * Examples: Add two-stage load support to fxload (#12) |
| 95 | * Correctly report cancellations due to timeouts |
Chris Dickens | d73bc72 | 2015-07-29 01:06:37 -0700 | [diff] [blame] | 96 | * Improve efficiency of event handling |
| 97 | * Improve speed of transfer submission in multi-threaded environments |
| 98 | * Various other bug fixes and improvements |
| 99 | The (#xx) numbers are libusb issue numbers, see ie: |
| 100 | https://github.com/libusb/libusb/issues/16 |
| 101 | |
Hans de Goede | f3587bb | 2014-05-30 14:48:28 +0200 | [diff] [blame] | 102 | 2014-05-30: v1.0.19 |
Hans de Goede | edaa1af | 2014-05-02 15:25:26 +0200 | [diff] [blame] | 103 | * Add support for USB bulk streams on Linux and Mac OS X (#11) |
| 104 | * Windows: Add AMD and Intel USB-3.0 root hub support |
| 105 | * Windows: Fix USB 3.0 speed detection on Windows 8 or later (#10) |
Hans de Goede | 5e77b88 | 2014-05-19 11:33:03 +0200 | [diff] [blame] | 106 | * Added Russian translation for libusb_strerror strings |
Hans de Goede | edaa1af | 2014-05-02 15:25:26 +0200 | [diff] [blame] | 107 | * All: Various small fixes and cleanups |
Hans de Goede | edaa1af | 2014-05-02 15:25:26 +0200 | [diff] [blame] | 108 | |
Pete Batard | a2f2c31 | 2014-01-25 22:43:39 +0000 | [diff] [blame] | 109 | 2014-01-25: v1.0.18 |
Pete Batard | 9a34bb7 | 2014-01-08 23:51:38 +0000 | [diff] [blame] | 110 | * Fix multiple memory leaks |
| 111 | * Fix a crash when HID transfers return no data on Windows |
| 112 | * Ensure all pending events are consumed |
| 113 | * Improve Android and ucLinux support |
| 114 | * Multiple Windows improvements (error logging, VS2013, VIA xHCI support) |
| 115 | * Multiple OS X improvements (broken compilation, SIGFPE, 64bit support) |
| 116 | |
Hans de Goede | 0c3d17c | 2013-09-06 11:20:53 +0200 | [diff] [blame] | 117 | 2013-09-06: v1.0.17 |
Hans de Goede | 6512943 | 2013-08-28 10:17:53 +0200 | [diff] [blame] | 118 | * Hotplug callbacks now always get passed a libusb_context, even if it is |
| 119 | the default context. Previously NULL would be passed for the default context, |
| 120 | but since the first context created is the default context, and most apps |
| 121 | use only 1 context, this meant that apps explicitly creating a context would |
| 122 | still get passed NULL |
| 123 | * Android: Add .mk files to build with the Android NDK |
| 124 | * Darwin: Add Xcode project |
| 125 | * Darwin: Fix crash on unplug (#121) |
| 126 | * Linux: Fix hang (deadlock) on libusb_exit |
hjelmn@cs.unm.edu | 1eff220 | 2014-01-08 23:50:34 +0000 | [diff] [blame] | 127 | * Linux: Fix libusb build failure with --disable-udev (#124) |
Hans de Goede | 6512943 | 2013-08-28 10:17:53 +0200 | [diff] [blame] | 128 | * Linux: Fix libusb_get_device_list() hang with --disable-udev (#130) |
| 129 | * OpenBSD: Update OpenBSD backend with support for control transfers to |
| 130 | non-ugen(4) devices and make get_configuration() no longer generate I/O. |
hjelmn@cs.unm.edu | 1eff220 | 2014-01-08 23:50:34 +0000 | [diff] [blame] | 131 | Note that using this libusb version on OpenBSD requires using |
Hans de Goede | 6512943 | 2013-08-28 10:17:53 +0200 | [diff] [blame] | 132 | OpenBSD 5.3-current or later. Users of older OpenBSD versions are advised |
| 133 | to stay with the libusb shipped with OpenBSD (mpi) |
| 134 | * Windows: fix libusb_dll_2010.vcxproj link errors (#129) |
| 135 | * Various other bug fixes and improvements |
Hans de Goede | 6512943 | 2013-08-28 10:17:53 +0200 | [diff] [blame] | 136 | |
Hans de Goede | d1ed6c4 | 2013-07-11 11:04:02 +0200 | [diff] [blame] | 137 | 2013-07-11: v1.0.16 |
Hans de Goede | e2fe75e | 2013-06-20 15:18:10 +0200 | [diff] [blame] | 138 | * Add hotplug support for Darwin and Linux (#9) |
| 139 | * Add superspeed endpoint companion descriptor support (#15) |
| 140 | * Add BOS descriptor support (#15) |
| 141 | * Make descriptor parsing code more robust |
| 142 | * New libusb_get_port_numbers API, this is libusb_get_port_path without |
| 143 | the unnecessary context parameter, libusb_get_port_path is now deprecated |
| 144 | * New libusb_strerror API (#14) |
| 145 | * New libusb_set_auto_detach_kernel_driver API (#17) |
Hans de Goede | faa6241 | 2013-07-06 09:09:25 +0200 | [diff] [blame] | 146 | * Improve topology API docs (#95) |
Hans de Goede | ea39a14 | 2013-07-01 13:00:43 +0200 | [diff] [blame] | 147 | * Logging now use a single write call per log-message, avoiding log-message |
| 148 | "interlacing" when using multiple threads. |
Hans de Goede | e2fe75e | 2013-06-20 15:18:10 +0200 | [diff] [blame] | 149 | * Android: use Android logging when building on Android (#101) |
| 150 | * Darwin: make libusb_reset reenumerate device on descriptors change (#89) |
| 151 | * Darwin: add support for the LIBUSB_TRANSFER_ADD_ZERO_PACKET flag (#91) |
| 152 | * Darwin: add a device cache (#112, #114) |
| 153 | * Examples: Add sam3u_benchmark isochronous example by Harald Welte (#109) |
| 154 | * Many other bug fixes and improvements |
| 155 | The (#xx) numbers are libusbx issue numbers, see ie: |
| 156 | https://github.com/libusbx/libusbx/issues/9 |
| 157 | |
Pete Batard | 85f1bed | 2013-04-15 23:15:10 +0100 | [diff] [blame] | 158 | 2013-04-15: v1.0.15 |
Pete Batard | ad3e3d4 | 2013-04-04 19:03:15 +0100 | [diff] [blame] | 159 | * Improve transfer cancellation and avoid short read failures on broken descriptors |
Pete Batard | 196acee | 2013-04-02 19:52:16 +0100 | [diff] [blame] | 160 | * Filter out 8-bit characters in libusb_get_string_descriptor_ascii() |
| 161 | * Add WinCE support |
| 162 | * Add library stress tests |
Pete Batard | ad3e3d4 | 2013-04-04 19:03:15 +0100 | [diff] [blame] | 163 | * Add Cypress FX3 firmware upload support for fxload sample |
Pete Batard | 196acee | 2013-04-02 19:52:16 +0100 | [diff] [blame] | 164 | * Add HID and kernel driver detach support capabilities detection |
| 165 | * Add SuperSpeed detection on OS X |
Pete Batard | 85f1bed | 2013-04-15 23:15:10 +0100 | [diff] [blame] | 166 | * Fix bInterval value interpretation on OS X |
Pete Batard | 196acee | 2013-04-02 19:52:16 +0100 | [diff] [blame] | 167 | * Fix issues with autoclaim, composite HID devices, interface autoclaim and |
Pete Batard | ad3e3d4 | 2013-04-04 19:03:15 +0100 | [diff] [blame] | 168 | early abort in libusb_close() on Windows. Also add VS2012 solution files. |
Pete Batard | 196acee | 2013-04-02 19:52:16 +0100 | [diff] [blame] | 169 | * Improve fd event handling on Linux |
| 170 | * Other bug fixes and improvements |
| 171 | |
Pete Batard | f17d190 | 2012-09-25 00:35:32 +0100 | [diff] [blame] | 172 | 2012-09-26: v1.0.14 |
| 173 | * Reverts the previous API change with regards to bMaxPower. |
| 174 | If this doesn't matter to you, you are encouraged to keep using v1.0.13, |
| 175 | as it will use the same attribute as v2.0, to be released soon. |
hjelmn@cs.unm.edu | 1eff220 | 2014-01-08 23:50:34 +0000 | [diff] [blame] | 176 | * Note that LIBUSB_API_VERSION is *decreased* to 0x010000FF and the previous |
Pete Batard | 85f1bed | 2013-04-15 23:15:10 +0100 | [diff] [blame] | 177 | guidelines with regards to concurrent use of MaxPower/bMaxPower still apply. |
Pete Batard | f17d190 | 2012-09-25 00:35:32 +0100 | [diff] [blame] | 178 | |
| 179 | 2012-09-20: v1.0.13 |
| 180 | * [MAJOR] Fix a typo in the API with struct libusb_config_descriptor where |
| 181 | MaxPower was used instead of bMaxPower, as defined in the specs. If your |
| 182 | application was accessing the MaxPower attribute, and you need to maintain |
| 183 | compatibility with libusb or older versions, see APPENDIX A below. |
| 184 | * Fix broken support for the 0.1 -> 1.0 libusb-compat layer |
| 185 | * Fix unwanted cancellation of pending timeouts as well as major timeout related bugs |
| 186 | * Fix handling of HID and composite devices on Windows |
hjelmn@cs.unm.edu | 1eff220 | 2014-01-08 23:50:34 +0000 | [diff] [blame] | 187 | * Introduce LIBUSB_API_VERSION macro |
Pete Batard | f17d190 | 2012-09-25 00:35:32 +0100 | [diff] [blame] | 188 | * Add Cypress FX/FX2 firmware upload sample, based on fxload from |
| 189 | http://linux-hotplug.sourceforge.net |
| 190 | * Add libusb0 (libusb-win32) and libusbK driver support on Windows. Note that while |
hjelmn@cs.unm.edu | 1eff220 | 2014-01-08 23:50:34 +0000 | [diff] [blame] | 191 | the drivers allow it, isochronous transfers are not supported yet in libusb. Also |
Pete Batard | f17d190 | 2012-09-25 00:35:32 +0100 | [diff] [blame] | 192 | not supported yet is the use of libusb-win32 filter drivers on composite interfaces |
| 193 | * Add support for the new get_capabilities ioctl on Linux and avoid unnecessary |
| 194 | splitting of bulk transfers |
| 195 | * Improve support for newer Intel and Renesas USB 3.0 controllers on Windows |
| 196 | * Harmonize the device number for root hubs across platforms |
| 197 | * Other bug fixes and improvements |
| 198 | |
| 199 | 2012-06-15: v1.0.12 |
| 200 | * Fix a potential major regression with pthread on Linux |
| 201 | * Fix missing thread ID from debug log output on cygwin |
| 202 | * Fix possible crash when using longjmp and MinGW's gcc 4.6 |
| 203 | * Add topology calls: libusb_get_port_number(), libusb_get_parent() & libusb_get_port_path() |
| 204 | * Add toggleable debug, using libusb_set_debug() or the LIBUSB_DEBUG environment variable |
| 205 | * Define log levels in libusb.h and set timestamp origin to first libusb_init() call |
| 206 | * All logging is now sent to to stderr (info was sent to stdout previously) |
| 207 | * Update log messages severity and avoid polluting log output on OS-X |
| 208 | * Add HID driver support on Windows |
| 209 | * Enable interchangeability of MSVC and MinGW DLLs |
| 210 | * Additional bug fixes and improvements |
| 211 | |
| 212 | 2012-05-08: v1.0.11 |
| 213 | * Revert removal of critical Windows event handling that was introduced in 1.0.10 |
| 214 | * Fix a possible deadlock in Windows when submitting transfers |
| 215 | * Add timestamped logging |
| 216 | * Add NetBSD support (experimental) and BSD libusb_get_device_speed() data |
| 217 | * Add bootstrap.sh alongside autogen.sh (bootstrap.sh doesn't invoke configure) |
| 218 | * Search for device nodes in /dev for Android support |
| 219 | * Other bug fixes |
| 220 | |
| 221 | 2012-04-17: v1.0.10 |
| 222 | * Public release |
| 223 | * Add libusb_get_version |
| 224 | * Add Visual Studio 2010 project files |
| 225 | * Some Windows code cleanup |
| 226 | * Fix xusb sample warnings |
| 227 | |
| 228 | 2012-04-02: v1.0.9 |
| 229 | * First libusbx release |
| 230 | * Add libusb_get_device_speed (all, except BSD) and libusb_error_name |
| 231 | * Add Windows support (WinUSB driver only) |
| 232 | * Add OpenBSD support |
| 233 | * Add xusb sample |
| 234 | * Tons of bug fixes |
| 235 | |
| 236 | 2010-05-07: v1.0.8 |
| 237 | * Bug fixes |
| 238 | |
| 239 | 2010-04-19: v1.0.7 |
| 240 | * Bug fixes and documentation tweaks |
| 241 | * Add more interface class definitions |
| 242 | |
| 243 | 2009-11-22: v1.0.6 |
| 244 | * Bug fixes |
| 245 | * Increase libusb_handle_events() timeout to 60s for powersaving |
| 246 | |
| 247 | 2009-11-15: v1.0.5 |
| 248 | * Use timerfd when available for timer management |
| 249 | * Small fixes/updates |
| 250 | |
| 251 | 2009-11-06: v1.0.4 release |
| 252 | * Bug fixes including transfer locking to fix some potential threading races |
| 253 | * More flexibility with clock types on Linux |
| 254 | * Use new bulk continuation tracking in Linux 2.6.32 for improved handling |
| 255 | of short/failed transfers |
| 256 | |
| 257 | 2009-08-27: v1.0.3 release |
| 258 | * Bug fixes |
| 259 | * Add libusb_get_max_iso_packet_size() |
| 260 | |
| 261 | 2009-06-13: v1.0.2 release |
| 262 | * Bug fixes |
| 263 | |
| 264 | 2009-05-12: v1.0.1 release |
| 265 | * Bug fixes |
| 266 | * Darwin backend |
| 267 | |
| 268 | 2008-12-13: v1.0.0 release |
| 269 | * Bug fixes |
| 270 | |
| 271 | 2008-11-21: v0.9.4 release |
| 272 | * Bug fixes |
| 273 | * Add libusb_attach_kernel_driver() |
| 274 | |
| 275 | 2008-08-23: v0.9.3 release |
| 276 | * Bug fixes |
| 277 | |
| 278 | 2008-07-19: v0.9.2 release |
| 279 | * Bug fixes |
| 280 | |
| 281 | 2008-06-28: v0.9.1 release |
| 282 | * Bug fixes |
| 283 | * Introduce contexts to the API |
| 284 | * Compatibility with new Linux kernel features |
| 285 | |
| 286 | 2008-05-25: v0.9.0 release |
| 287 | * First libusb-1.0 beta release |
| 288 | |
| 289 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 290 | |
| 291 | APPENDIX A - How to maintain code compatibility with versions of libusb and |
hjelmn@cs.unm.edu | 1eff220 | 2014-01-08 23:50:34 +0000 | [diff] [blame] | 292 | libusb that use MaxPower: |
Pete Batard | f17d190 | 2012-09-25 00:35:32 +0100 | [diff] [blame] | 293 | |
| 294 | If you must to maintain compatibility with versions of the library that aren't |
| 295 | using the bMaxPower attribute in struct libusb_config_descriptor, the |
hjelmn@cs.unm.edu | 1eff220 | 2014-01-08 23:50:34 +0000 | [diff] [blame] | 296 | recommended way is to use the new LIBUSB_API_VERSION macro with an #ifdef. |
Pete Batard | f17d190 | 2012-09-25 00:35:32 +0100 | [diff] [blame] | 297 | For instance, if your code was written as follows: |
| 298 | |
| 299 | if (dev->config[0].MaxPower < 250) |
| 300 | |
| 301 | Then you should modify it to have: |
| 302 | |
hjelmn@cs.unm.edu | 1eff220 | 2014-01-08 23:50:34 +0000 | [diff] [blame] | 303 | #if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01000100) |
Pete Batard | f17d190 | 2012-09-25 00:35:32 +0100 | [diff] [blame] | 304 | if (dev->config[0].bMaxPower < 250) |
| 305 | #else |
| 306 | if (dev->config[0].MaxPower < 250) |
| 307 | #endif |