Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: SWIG Python wrapper for libavrdude #1714

Open
wants to merge 152 commits into
base: main
Choose a base branch
from

Conversation

dl8dtl
Copy link
Contributor

@dl8dtl dl8dtl commented Mar 3, 2024

The purpose of this branch / pull request is to eventually establish enough of a Python wrapper to allow a full feature-compatible Python version of AVRDUDE. This will allow it to be embedded in scripting frameworks, or to be used by something like a real GUI wrapper.

@mcuee mcuee added the enhancement New feature or request label Mar 4, 2024
@mcuee
Copy link
Collaborator

mcuee commented Mar 6, 2024

This does not work under MSYS2 mingw64.

Personally I always find Python bindings using swig to be problematic to build under Windows. I have never tried to use swig with MSVC either.

$ python --version
Python 3.11.7

$ swig -version

SWIG Version 4.1.1

Compiled with g++ [x86_64-w64-mingw32]

Configured options: +pcre

Please see https://www.swig.org for reporting bugs and further information

$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-13.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/include --libexecdir=/mingw64/lib --enable-bootstrap --enable-checking=release --with-arch=nocona --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts --enable-libstdcxx-time --disable-libstdcxx-pch --enable-lto --enable-libgomp --disable-libssp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev3, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --disable-libstdcxx-debug --with-boot-ldflags=-static-libstdc++ --with-stage1-ldflags=-static-libstdc++
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.0 (Rev3, Built by MSYS2 project)
Failed build log under MSYS2 mingw64
$ ./build.sh
-- Building for: Ninja
-- The C compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Git: C:/msys64/usr/bin/git.exe (found version "2.43.0")
-- Found FLEX: C:/msys64/usr/bin/flex.exe (found version "2.6.4")
-- Found BISON: C:/msys64/usr/bin/bison.exe (found version "3.8.2")
-- Looking for libelf.h
-- Looking for libelf.h - found
-- Looking for libelf/libelf.h
-- Looking for libelf/libelf.h - found
-- Looking for usb.h
-- Looking for usb.h - not found
-- Looking for lusb0_usb.h
-- Looking for lusb0_usb.h - found
-- Looking for libusb.h
-- Looking for libusb.h - not found
-- Looking for libusb-1.0/libusb.h
-- Looking for libusb-1.0/libusb.h - found
-- Looking for hidapi/hidapi.h
-- Looking for hidapi/hidapi.h - found
-- Looking for ftdi_tcioflush
-- Looking for ftdi_tcioflush - found
-- Found SWIG: C:/msys64/mingw64/bin/swig.exe (found suitable version "4.1.1", minimum required is "4.0") found components: python
CMake Warning (dev) at CMakeLists.txt:253 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonLibs: C:/msys64/mingw64/lib/libpython3.11.dll.a (found version "3.11.7")
-- Configuration summary:
-- ----------------------
-- DO HAVE    libelf
-- DO HAVE    libusb
-- DO HAVE    libusb_1_0
-- DO HAVE    libhidapi
-- DON'T HAVE libftdi
-- DO HAVE    libftdi1
-- DO HAVE    libreadline
-- DO HAVE    libserialport
-- DISABLED   doc
-- DISABLED   parport
-- DISABLED   linuxgpio
-- DISABLED   linuxspi
-- DO HAVE    swig
-- ----------------------
-- Configuring done (47.8s)
-- Generating done (0.1s)
-- Build files have been written to: C:/work/avr/avrdude_test/avrdude_jw/build_mingw64_nt-10.0-19045
[2/148] Swig compile libavrdude.i for python
C:\work\avr\avrdude_test\avrdude_jw\src\libavrdude.i(54) : Warning 462: Unable to set variable of type char []
C:\work\avr\avrdude_test\avrdude_jw\src\libavrdude.i(58) : Warning 451: Setting a const char * variable may leak memory.
C:\work\avr\avrdude_test\avrdude_jw\src\libavrdude.i(59) : Warning 451: Setting a const char * variable may leak memory.
[85/148] Building C object src/CMakeFiles/swig_avrdude.dir/dfu.c.obj
FAILED: src/CMakeFiles/swig_avrdude.dir/dfu.c.obj
C:\msys64\mingw64\bin\cc.exe -DCONFIG_DIR="\"C:/Program Files (x86)/avrdude/etc\"" -Dswig_avrdude_EXPORTS -IC:/work/avr/avrdude_test/avrdude_jw/build_mingw64_nt-10.0-19045/src -IC:/msys64/mingw64/include/python3.11 -IC:/work/avr/avrdude_test/avrdude_jw/src -IC:/work/avr/avrdude_test/avrdude_jw/build_mingw64_nt-10.0-19045/src/.. -O2 -g -DNDEBUG -std=gnu11 -Wall -Wextra -Wno-unused-parameter -MD -MT src/CMakeFiles/swig_avrdude.dir/dfu.c.obj -MF src\CMakeFiles\swig_avrdude.dir\dfu.c.obj.d -o src/CMakeFiles/swig_avrdude.dir/dfu.c.obj -c C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c
In file included from C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:28,
                 from C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:33:
C:/msys64/mingw64/include/usb.h:27:9: error: unknown type name 'PVOID'
   27 | typedef PVOID PIRP;
      |         ^~~~~
C:/msys64/mingw64/include/usb.h:28:9: error: unknown type name 'PVOID'
   28 | typedef PVOID PMDL;
      |         ^~~~~
In file included from C:/msys64/mingw64/include/usb.h:34:
C:/msys64/mingw64/include/usbspec.h:28:5: error: unknown type name 'UCHAR'
   28 |     UCHAR Recipient:2;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:29:5: error: unknown type name 'UCHAR'
   29 |     UCHAR Reserved:3;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:30:5: error: unknown type name 'UCHAR'
   30 |     UCHAR Type:2;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:31:5: error: unknown type name 'UCHAR'
   31 |     UCHAR Dir:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:33:3: error: unknown type name 'UCHAR'
   33 |   UCHAR B;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:38:3: error: unknown type name 'UCHAR'
   38 |   UCHAR bRequest;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:41:7: error: unknown type name 'UCHAR'
   41 |       UCHAR LowByte;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:42:7: error: unknown type name 'UCHAR'
   42 |       UCHAR HiByte;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:44:5: error: unknown type name 'USHORT'
   44 |     USHORT W;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:48:7: error: unknown type name 'UCHAR'
   48 |       UCHAR LowByte;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:49:7: error: unknown type name 'UCHAR'
   49 |       UCHAR HiByte;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:51:5: error: unknown type name 'USHORT'
   51 |     USHORT W;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:53:3: error: unknown type name 'USHORT'
   53 |   USHORT wLength;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:136:3: error: unknown type name 'USHORT'
  136 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:138:5: error: unknown type name 'USHORT'
  138 |     USHORT SelfPowered : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:139:5: error: unknown type name 'USHORT'
  139 |     USHORT RemoteWakeup : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:140:5: error: unknown type name 'USHORT'
  140 |     USHORT U1Enable : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:141:5: error: unknown type name 'USHORT'
  141 |     USHORT U2Enable : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:142:5: error: unknown type name 'USHORT'
  142 |     USHORT LtmEnable : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:143:5: error: unknown type name 'USHORT'
  143 |     USHORT Reserved : 11;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:148:3: error: unknown type name 'USHORT'
  148 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:150:5: error: unknown type name 'USHORT'
  150 |     USHORT RemoteWakeupCapable : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:151:5: error: unknown type name 'USHORT'
  151 |     USHORT RemoteWakeupEnabled : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:152:5: error: unknown type name 'USHORT'
  152 |     USHORT Reserved : 14;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:157:3: error: unknown type name 'USHORT'
  157 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:159:5: error: unknown type name 'USHORT'
  159 |     USHORT Halt : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:160:5: error: unknown type name 'USHORT'
  160 |     USHORT Reserved : 15;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:165:3: error: unknown type name 'UCHAR'
  165 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:166:3: error: unknown type name 'UCHAR'
  166 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:170:3: error: unknown type name 'UCHAR'
  170 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:171:3: error: unknown type name 'UCHAR'
  171 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:172:3: error: unknown type name 'USHORT'
  172 |   USHORT bcdUSB;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:173:3: error: unknown type name 'UCHAR'
  173 |   UCHAR bDeviceClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:174:3: error: unknown type name 'UCHAR'
  174 |   UCHAR bDeviceSubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:175:3: error: unknown type name 'UCHAR'
  175 |   UCHAR bDeviceProtocol;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:176:3: error: unknown type name 'UCHAR'
  176 |   UCHAR bMaxPacketSize0;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:177:3: error: unknown type name 'USHORT'
  177 |   USHORT idVendor;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:178:3: error: unknown type name 'USHORT'
  178 |   USHORT idProduct;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:179:3: error: unknown type name 'USHORT'
  179 |   USHORT bcdDevice;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:180:3: error: unknown type name 'UCHAR'
  180 |   UCHAR iManufacturer;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:181:3: error: unknown type name 'UCHAR'
  181 |   UCHAR iProduct;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:182:3: error: unknown type name 'UCHAR'
  182 |   UCHAR iSerialNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:183:3: error: unknown type name 'UCHAR'
  183 |   UCHAR bNumConfigurations;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:211:3: error: unknown type name 'UCHAR'
  211 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:212:3: error: unknown type name 'UCHAR'
  212 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:213:3: error: unknown type name 'USHORT'
  213 |   USHORT bcdUSB;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:214:3: error: unknown type name 'UCHAR'
  214 |   UCHAR bDeviceClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:215:3: error: unknown type name 'UCHAR'
  215 |   UCHAR bDeviceSubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:216:3: error: unknown type name 'UCHAR'
  216 |   UCHAR bDeviceProtocol;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:217:3: error: unknown type name 'UCHAR'
  217 |   UCHAR bMaxPacketSize0;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:218:3: error: unknown type name 'UCHAR'
  218 |   UCHAR bNumConfigurations;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:219:3: error: unknown type name 'UCHAR'
  219 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:223:3: error: unknown type name 'UCHAR'
  223 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:224:3: error: unknown type name 'UCHAR'
  224 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:225:3: error: unknown type name 'USHORT'
  225 |   USHORT wTotalLength;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:226:3: error: unknown type name 'UCHAR'
  226 |   UCHAR bNumDeviceCaps;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:243:3: error: unknown type name 'UCHAR'
  243 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:244:3: error: unknown type name 'UCHAR'
  244 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:245:3: error: unknown type name 'UCHAR'
  245 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:247:5: error: unknown type name 'ULONG'
  247 |     ULONG AsUlong;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:249:7: error: unknown type name 'ULONG'
  249 |       ULONG Reserved:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:250:7: error: unknown type name 'ULONG'
  250 |       ULONG LPMCapable:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:251:7: error: unknown type name 'ULONG'
  251 |       ULONG BESLAndAlternateHIRDSupported:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:252:7: error: unknown type name 'ULONG'
  252 |       ULONG BaselineBESLValid:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:253:7: error: unknown type name 'ULONG'
  253 |       ULONG DeepBESLValid:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:254:7: error: unknown type name 'ULONG'
  254 |       ULONG Reserved1:3;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:255:7: error: unknown type name 'ULONG'
  255 |       ULONG BaselineBESL:4;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:256:7: error: unknown type name 'ULONG'
  256 |       ULONG DeepBESL:4;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:257:7: error: unknown type name 'ULONG'
  257 |       ULONG Reserved2:16;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:265:3: error: unknown type name 'UCHAR'
  265 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:266:3: error: unknown type name 'UCHAR'
  266 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:267:3: error: unknown type name 'UCHAR'
  267 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:268:3: error: unknown type name 'UCHAR'
  268 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:270:5: error: unknown type name 'ULONG'
  270 |     ULONG AsUlong;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:272:7: error: unknown type name 'ULONG'
  272 |       ULONG Reserved1:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:273:7: error: unknown type name 'ULONG'
  273 |       ULONG BatteryCharging:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:274:7: error: unknown type name 'ULONG'
  274 |       ULONG USBPowerDelivery:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:275:7: error: unknown type name 'ULONG'
  275 |       ULONG Provider:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:276:7: error: unknown type name 'ULONG'
  276 |       ULONG Consumer:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:277:7: error: unknown type name 'ULONG'
  277 |       ULONG ChargingPolicy:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:278:7: error: unknown type name 'ULONG'
  278 |       ULONG TypeCCurrent:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:279:7: error: unknown type name 'ULONG'
  279 |       ULONG Reserved2:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:280:7: error: unknown type name 'ULONG'
  280 |       ULONG ACSupply:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:281:7: error: unknown type name 'ULONG'
  281 |       ULONG Battery:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:282:7: error: unknown type name 'ULONG'
  282 |       ULONG Other:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:283:7: error: unknown type name 'ULONG'
  283 |       ULONG NumBatteries:3;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:284:7: error: unknown type name 'ULONG'
  284 |       ULONG UsesVbus:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:285:7: error: unknown type name 'ULONG'
  285 |       ULONG Reserved3:17;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:288:3: error: unknown type name 'USHORT'
  288 |   USHORT bmProviderPorts;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:289:3: error: unknown type name 'USHORT'
  289 |   USHORT bmConsumerPorts;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:290:3: error: unknown type name 'USHORT'
  290 |   USHORT bcdBCVersion;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:291:3: error: unknown type name 'USHORT'
  291 |   USHORT bcdPDVersion;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:292:3: error: unknown type name 'USHORT'
  292 |   USHORT bcdUSBTypeCVersion;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:296:3: error: unknown type name 'UCHAR'
  296 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:297:3: error: unknown type name 'UCHAR'
  297 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:298:3: error: unknown type name 'UCHAR'
  298 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:299:3: error: unknown type name 'UCHAR'
  299 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:301:5: error: unknown type name 'USHORT'
  301 |     USHORT AsUshort;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:303:9: error: unknown type name 'USHORT'
  303 |         USHORT BatteryCharging:1;
      |         ^~~~~~
C:/msys64/mingw64/include/usbspec.h:304:9: error: unknown type name 'USHORT'
  304 |         USHORT USBPowerDelivery:1;
      |         ^~~~~~
C:/msys64/mingw64/include/usbspec.h:305:9: error: unknown type name 'USHORT'
  305 |         USHORT USBTypeCCurrent:1;
      |         ^~~~~~
C:/msys64/mingw64/include/usbspec.h:306:9: error: unknown type name 'USHORT'
  306 |         USHORT Reserved:13;
      |         ^~~~~~
C:/msys64/mingw64/include/usbspec.h:309:3: error: unknown type name 'USHORT'
  309 |   USHORT wMinVoltage;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:310:3: error: unknown type name 'USHORT'
  310 |   USHORT wMaxVoltage;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:311:3: error: unknown type name 'USHORT'
  311 |   USHORT wReserved;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:312:3: error: unknown type name 'ULONG'
  312 |   ULONG dwMaxOperatingPower;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:313:3: error: unknown type name 'ULONG'
  313 |   ULONG dwMaxPeakPower;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:314:3: error: unknown type name 'ULONG'
  314 |   ULONG dwMaxPeakPowerTime;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:318:3: error: unknown type name 'UCHAR'
  318 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:319:3: error: unknown type name 'UCHAR'
  319 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:320:3: error: unknown type name 'UCHAR'
  320 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:321:3: error: unknown type name 'UCHAR'
  321 |   UCHAR bmAttributes;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:322:3: error: unknown type name 'USHORT'
  322 |   USHORT wSpeedsSupported;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:323:3: error: unknown type name 'UCHAR'
  323 |   UCHAR bFunctionalitySupport;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:324:3: error: unknown type name 'UCHAR'
  324 |   UCHAR bU1DevExitLat;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:325:3: error: unknown type name 'USHORT'
  325 |   USHORT wU2DevExitLat;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:363:3: error: unknown type name 'ULONG'
  363 |   ULONG AsUlong32;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:365:5: error: unknown type name 'ULONG'
  365 |     ULONG SublinkSpeedAttrID:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:366:5: error: unknown type name 'ULONG'
  366 |     ULONG LaneSpeedExponent:2;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:367:5: error: unknown type name 'ULONG'
  367 |     ULONG SublinkTypeMode:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:368:5: error: unknown type name 'ULONG'
  368 |     ULONG SublinkTypeDir:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:369:5: error: unknown type name 'ULONG'
  369 |     ULONG Reserved:6;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:370:5: error: unknown type name 'ULONG'
  370 |     ULONG LinkProtocol:2;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:371:5: error: unknown type name 'ULONG'
  371 |     ULONG LaneSpeedMantissa:16;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:376:3: error: unknown type name 'UCHAR'
  376 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:377:3: error: unknown type name 'UCHAR'
  377 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:378:3: error: unknown type name 'UCHAR'
  378 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:379:3: error: unknown type name 'UCHAR'
  379 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:381:5: error: unknown type name 'ULONG'
  381 |     ULONG AsUlong;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:383:7: error: unknown type name 'ULONG'
  383 |       ULONG SublinkSpeedAttrCount:5;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:384:7: error: unknown type name 'ULONG'
  384 |       ULONG SublinkSpeedIDCount:4;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:385:7: error: unknown type name 'ULONG'
  385 |       ULONG Reserved:23;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:389:5: error: unknown type name 'USHORT'
  389 |     USHORT AsUshort;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:391:7: error: unknown type name 'USHORT'
  391 |       USHORT SublinkSpeedAttrID:4;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:392:7: error: unknown type name 'USHORT'
  392 |       USHORT Reserved:4;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:393:7: error: unknown type name 'USHORT'
  393 |       USHORT MinRxLaneCount:4;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:394:7: error: unknown type name 'USHORT'
  394 |       USHORT MinTxLaneCount:4;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:397:3: error: unknown type name 'USHORT'
  397 |   USHORT wReserved;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:402:3: error: unknown type name 'UCHAR'
  402 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:403:3: error: unknown type name 'UCHAR'
  403 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:404:3: error: unknown type name 'UCHAR'
  404 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:405:3: error: unknown type name 'UCHAR'
  405 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:406:3: error: unknown type name 'UCHAR'
  406 |   UCHAR ContainerID[16];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:410:3: error: unknown type name 'UCHAR'
  410 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:411:3: error: unknown type name 'UCHAR'
  411 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:412:3: error: unknown type name 'UCHAR'
  412 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:413:3: error: unknown type name 'UCHAR'
  413 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:414:3: error: unknown type name 'GUID'
  414 |   GUID PlatformCapabilityUuid;
      |   ^~~~
C:/msys64/mingw64/include/usbspec.h:415:3: error: unknown type name 'UCHAR'
  415 |   UCHAR CapabililityData[1];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:419:3: error: unknown type name 'UCHAR'
  419 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:420:3: error: unknown type name 'UCHAR'
  420 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:421:3: error: unknown type name 'UCHAR'
  421 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:422:3: error: unknown type name 'UCHAR'
  422 |   UCHAR iAddtionalInfoURL;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:423:3: error: unknown type name 'UCHAR'
  423 |   UCHAR bNumberOfAlternateModes;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:424:3: error: unknown type name 'UCHAR'
  424 |   UCHAR bPreferredAlternateMode;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:426:5: error: unknown type name 'USHORT'
  426 |     USHORT AsUshort;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:428:7: error: unknown type name 'USHORT'
  428 |       USHORT VConnPowerNeededForFullFunctionality:3;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:429:7: error: unknown type name 'USHORT'
  429 |       USHORT Reserved:12;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:430:7: error: unknown type name 'USHORT'
  430 |       USHORT NoVconnPowerRequired:1;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:433:3: error: unknown type name 'UCHAR'
  433 |   UCHAR bmConfigured[32];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:434:3: error: unknown type name 'ULONG'
  434 |   ULONG bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:436:5: error: unknown type name 'USHORT'
  436 |     USHORT wSVID;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:437:5: error: unknown type name 'UCHAR'
  437 |     UCHAR bAlternateMode;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:438:5: error: unknown type name 'UCHAR'
  438 |     UCHAR iAlternateModeSetting;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:442:52: error: expected ')' before numeric constant
  442 | DEFINE_GUID(GUID_USB_MSOS20_PLATFORM_CAPABILITY_ID, 0xD8DD60DF, 0x4589, 0x4CC7, 0x9C, 0xD2, 0x65, 0x9D, 0x9E, 0x64, 0x8A, 0x9F);
      |                                                    ^~~~~~~~~~~
      |                                                    )
C:/msys64/mingw64/include/usbspec.h:445:3: error: unknown type name 'UCHAR'
  445 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:446:3: error: unknown type name 'UCHAR'
  446 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:447:3: error: unknown type name 'UCHAR'
  447 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:451:3: error: unknown type name 'UCHAR'
  451 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:452:3: error: unknown type name 'UCHAR'
  452 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:453:3: error: unknown type name 'USHORT'
  453 |   USHORT wTotalLength;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:454:3: error: unknown type name 'UCHAR'
  454 |   UCHAR bNumInterfaces;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:455:3: error: unknown type name 'UCHAR'
  455 |   UCHAR bConfigurationValue;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:456:3: error: unknown type name 'UCHAR'
  456 |   UCHAR iConfiguration;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:457:3: error: unknown type name 'UCHAR'
  457 |   UCHAR bmAttributes;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:458:3: error: unknown type name 'UCHAR'
  458 |   UCHAR MaxPower;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:468:3: error: unknown type name 'UCHAR'
  468 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:469:3: error: unknown type name 'UCHAR'
  469 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:470:3: error: unknown type name 'UCHAR'
  470 |   UCHAR bFirstInterface;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:471:3: error: unknown type name 'UCHAR'
  471 |   UCHAR bInterfaceCount;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:472:3: error: unknown type name 'UCHAR'
  472 |   UCHAR bFunctionClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:473:3: error: unknown type name 'UCHAR'
  473 |   UCHAR bFunctionSubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:474:3: error: unknown type name 'UCHAR'
  474 |   UCHAR bFunctionProtocol;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:475:3: error: unknown type name 'UCHAR'
  475 |   UCHAR iFunction;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:479:3: error: unknown type name 'UCHAR'
  479 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:480:3: error: unknown type name 'UCHAR'
  480 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:481:3: error: unknown type name 'UCHAR'
  481 |   UCHAR bInterfaceNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:482:3: error: unknown type name 'UCHAR'
  482 |   UCHAR bAlternateSetting;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:483:3: error: unknown type name 'UCHAR'
  483 |   UCHAR bNumEndpoints;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:484:3: error: unknown type name 'UCHAR'
  484 |   UCHAR bInterfaceClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:485:3: error: unknown type name 'UCHAR'
  485 |   UCHAR bInterfaceSubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:486:3: error: unknown type name 'UCHAR'
  486 |   UCHAR bInterfaceProtocol;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:487:3: error: unknown type name 'UCHAR'
  487 |   UCHAR iInterface;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:491:3: error: unknown type name 'UCHAR'
  491 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:492:3: error: unknown type name 'UCHAR'
  492 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:493:3: error: unknown type name 'UCHAR'
  493 |   UCHAR bEndpointAddress;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:494:3: error: unknown type name 'UCHAR'
  494 |   UCHAR bmAttributes;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:495:3: error: unknown type name 'USHORT'
  495 |   USHORT wMaxPacketSize;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:496:3: error: unknown type name 'UCHAR'
  496 |   UCHAR bInterval;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:540:5: error: unknown type name 'USHORT'
  540 |     USHORT MaxPacket : 11;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:541:5: error: unknown type name 'USHORT'
  541 |     USHORT HSmux : 2;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:542:5: error: unknown type name 'USHORT'
  542 |     USHORT Reserved : 3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:544:3: error: unknown type name 'USHORT'
  544 |   USHORT us;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:553:3: error: unknown type name 'UCHAR'
  553 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:554:3: error: unknown type name 'UCHAR'
  554 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:555:3: error: unknown type name 'WCHAR'
  555 |   WCHAR bString[1];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:561:3: error: unknown type name 'UCHAR'
  561 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:562:3: error: unknown type name 'UCHAR'
  562 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:563:3: error: unknown type name 'UCHAR'
  563 |   UCHAR bMaxBurst;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:565:5: error: unknown type name 'UCHAR'
  565 |     UCHAR AsUchar;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:567:7: error: unknown type name 'UCHAR'
  567 |       UCHAR MaxStreams:5;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:568:7: error: unknown type name 'UCHAR'
  568 |       UCHAR Reserved1:3;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:571:7: error: unknown type name 'UCHAR'
  571 |       UCHAR Mult:2;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:572:7: error: unknown type name 'UCHAR'
  572 |       UCHAR Reserved2:5;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:573:7: error: unknown type name 'UCHAR'
  573 |       UCHAR SspCompanion:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:576:3: error: unknown type name 'USHORT'
  576 |   USHORT wBytesPerInterval;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:582:3: error: unknown type name 'UCHAR'
  582 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:583:3: error: unknown type name 'UCHAR'
  583 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:584:3: error: unknown type name 'USHORT'
  584 |   USHORT wReserved;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:585:3: error: unknown type name 'ULONG'
  585 |   ULONG dwBytesPerInterval;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:592:3: error: unknown type name 'UCHAR'
  592 |   UCHAR bDescriptorLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:593:3: error: unknown type name 'UCHAR'
  593 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:594:3: error: unknown type name 'UCHAR'
  594 |   UCHAR bNumberOfPorts;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:595:3: error: unknown type name 'USHORT'
  595 |   USHORT wHubCharacteristics;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:596:3: error: unknown type name 'UCHAR'
  596 |   UCHAR bPowerOnToPowerGood;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:597:3: error: unknown type name 'UCHAR'
  597 |   UCHAR bHubControlCurrent;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:598:3: error: unknown type name 'UCHAR'
  598 |   UCHAR bRemoveAndPowerMask[64];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:604:3: error: unknown type name 'UCHAR'
  604 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:605:3: error: unknown type name 'UCHAR'
  605 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:606:3: error: unknown type name 'UCHAR'
  606 |   UCHAR bNumberOfPorts;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:607:3: error: unknown type name 'USHORT'
  607 |   USHORT wHubCharacteristics;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:608:3: error: unknown type name 'UCHAR'
  608 |   UCHAR bPowerOnToPowerGood;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:609:3: error: unknown type name 'UCHAR'
  609 |   UCHAR bHubControlCurrent;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:610:3: error: unknown type name 'UCHAR'
  610 |   UCHAR bHubHdrDecLat;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:611:3: error: unknown type name 'USHORT'
  611 |   USHORT wHubDelay;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:612:3: error: unknown type name 'USHORT'
  612 |   USHORT DeviceRemovable;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:628:3: error: unknown type name 'USHORT'
  628 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:630:5: error: unknown type name 'USHORT'
  630 |     USHORT LocalPowerLost:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:631:5: error: unknown type name 'USHORT'
  631 |     USHORT OverCurrent:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:632:5: error: unknown type name 'USHORT'
  632 |     USHORT Reserved:14;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:637:3: error: unknown type name 'USHORT'
  637 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:639:5: error: unknown type name 'USHORT'
  639 |     USHORT LocalPowerChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:640:5: error: unknown type name 'USHORT'
  640 |     USHORT OverCurrentChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:641:5: error: unknown type name 'USHORT'
  641 |     USHORT Reserved:14;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:646:3: error: unknown type name 'ULONG'
  646 |   ULONG AsUlong32;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:654:3: error: unknown type name 'USHORT'
  654 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:656:5: error: unknown type name 'USHORT'
  656 |     USHORT CurrentConnectStatus:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:657:5: error: unknown type name 'USHORT'
  657 |     USHORT PortEnabledDisabled:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:658:5: error: unknown type name 'USHORT'
  658 |     USHORT Suspend:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:659:5: error: unknown type name 'USHORT'
  659 |     USHORT OverCurrent:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:660:5: error: unknown type name 'USHORT'
  660 |     USHORT Reset:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:661:5: error: unknown type name 'USHORT'
  661 |     USHORT Reserved0:3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:662:5: error: unknown type name 'USHORT'
  662 |     USHORT PortPower:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:663:5: error: unknown type name 'USHORT'
  663 |     USHORT LowSpeedDeviceAttached:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:664:5: error: unknown type name 'USHORT'
  664 |     USHORT HighSpeedDeviceAttached:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:665:5: error: unknown type name 'USHORT'
  665 |     USHORT PortTestMode:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:666:5: error: unknown type name 'USHORT'
  666 |     USHORT PortIndicatorControl:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:667:5: error: unknown type name 'USHORT'
  667 |     USHORT Reserved1:3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:681:3: error: unknown type name 'USHORT'
  681 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:683:5: error: unknown type name 'USHORT'
  683 |     USHORT ConnectStatusChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:684:5: error: unknown type name 'USHORT'
  684 |     USHORT PortEnableDisableChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:685:5: error: unknown type name 'USHORT'
  685 |     USHORT SuspendChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:686:5: error: unknown type name 'USHORT'
  686 |     USHORT OverCurrentIndicatorChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:687:5: error: unknown type name 'USHORT'
  687 |     USHORT ResetChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:688:5: error: unknown type name 'USHORT'
  688 |     USHORT Reserved2:11;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:693:3: error: unknown type name 'USHORT'
  693 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:695:5: error: unknown type name 'USHORT'
  695 |     USHORT CurrentConnectStatus:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:696:5: error: unknown type name 'USHORT'
  696 |     USHORT PortEnabledDisabled:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:697:5: error: unknown type name 'USHORT'
  697 |     USHORT Reserved0:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:698:5: error: unknown type name 'USHORT'
  698 |     USHORT OverCurrent:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:699:5: error: unknown type name 'USHORT'
  699 |     USHORT Reset:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:700:5: error: unknown type name 'USHORT'
  700 |     USHORT PortLinkState:4;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:701:5: error: unknown type name 'USHORT'
  701 |     USHORT PortPower:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:702:5: error: unknown type name 'USHORT'
  702 |     USHORT NegotiatedDeviceSpeed:3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:703:5: error: unknown type name 'USHORT'
  703 |     USHORT Reserved1:3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:722:3: error: unknown type name 'USHORT'
  722 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:724:5: error: unknown type name 'USHORT'
  724 |     USHORT ConnectStatusChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:725:5: error: unknown type name 'USHORT'
  725 |     USHORT Reserved2:2;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:726:5: error: unknown type name 'USHORT'
  726 |     USHORT OverCurrentIndicatorChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:727:5: error: unknown type name 'USHORT'
  727 |     USHORT ResetChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:728:5: error: unknown type name 'USHORT'
  728 |     USHORT BHResetChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:729:5: error: unknown type name 'USHORT'
  729 |     USHORT PortLinkStateChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:730:5: error: unknown type name 'USHORT'
  730 |     USHORT PortConfigErrorChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:731:5: error: unknown type name 'USHORT'
  731 |     USHORT Reserved3:8;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:736:3: error: unknown type name 'USHORT'
  736 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:742:3: error: unknown type name 'USHORT'
  742 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:748:3: error: unknown type name 'ULONG'
  748 |   ULONG AsUlong32;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:750:5: error: unknown type name 'ULONG'
  750 |     ULONG RxSublinkSpeedID:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:751:5: error: unknown type name 'ULONG'
  751 |     ULONG TxSublinkSpeedID:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:752:5: error: unknown type name 'ULONG'
  752 |     ULONG RxLaneCount:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:753:5: error: unknown type name 'ULONG'
  753 |     ULONG TxLaneCount:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:754:5: error: unknown type name 'ULONG'
  754 |     ULONG Reserved:16;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:759:3: error: unknown type name 'ULONG'
  759 |   ULONG AsUlong32;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:767:3: error: unknown type name 'ULONG64'
  767 |   ULONG64 AsUlong64;
      |   ^~~~~~~
C:/msys64/mingw64/include/usbspec.h:775:3: error: unknown type name 'UCHAR'
  775 |   UCHAR AsUchar8;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:777:5: error: unknown type name 'UCHAR'
  777 |     UCHAR ConnectRemoteWakeEnable:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:778:5: error: unknown type name 'UCHAR'
  778 |     UCHAR DisconnectRemoteWakeEnable:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:779:5: error: unknown type name 'UCHAR'
  779 |     UCHAR OverCurrentRemoteWakeEnable:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:780:5: error: unknown type name 'UCHAR'
  780 |     UCHAR Reserved0:5;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:785:3: error: unknown type name 'UCHAR'
  785 |   UCHAR AsUchar;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:787:5: error: unknown type name 'UCHAR'
  787 |     UCHAR PowerState:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:788:5: error: unknown type name 'UCHAR'
  788 |     UCHAR RemoteWakeEnabled:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:789:5: error: unknown type name 'UCHAR'
  789 |     UCHAR Reserved:6;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:806:3: error: unknown type name 'UCHAR'
  806 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:807:3: error: unknown type name 'UCHAR'
  807 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:808:3: error: unknown type name 'UCHAR'
  808 |   UCHAR SelfPowerConsumedD0[3];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:809:3: error: unknown type name 'UCHAR'
  809 |   UCHAR bPowerSummaryId;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:810:3: error: unknown type name 'UCHAR'
  810 |   UCHAR bBusPowerSavingD1;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:811:3: error: unknown type name 'UCHAR'
  811 |   UCHAR bSelfPowerSavingD1;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:812:3: error: unknown type name 'UCHAR'
  812 |   UCHAR bBusPowerSavingD2;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:813:3: error: unknown type name 'UCHAR'
  813 |   UCHAR bSelfPowerSavingD2;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:814:3: error: unknown type name 'UCHAR'
  814 |   UCHAR bBusPowerSavingD3;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:815:3: error: unknown type name 'UCHAR'
  815 |   UCHAR bSelfPowerSavingD3;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:816:3: error: unknown type name 'USHORT'
  816 |   USHORT TransitionTimeFromD1;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:817:3: error: unknown type name 'USHORT'
  817 |   USHORT TransitionTimeFromD2;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:818:3: error: unknown type name 'USHORT'
  818 |   USHORT TransitionTimeFromD3;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:822:3: error: unknown type name 'UCHAR'
  822 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:823:3: error: unknown type name 'UCHAR'
  823 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:824:3: error: unknown type name 'UCHAR'
  824 |   UCHAR bmCapabilitiesFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:825:3: error: unknown type name 'UCHAR'
  825 |   UCHAR bBusPowerSavingD1;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:826:3: error: unknown type name 'UCHAR'
  826 |   UCHAR bSelfPowerSavingD1;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:827:3: error: unknown type name 'UCHAR'
  827 |   UCHAR bBusPowerSavingD2;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:828:3: error: unknown type name 'UCHAR'
  828 |   UCHAR bSelfPowerSavingD2;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:829:3: error: unknown type name 'UCHAR'
  829 |   UCHAR bBusPowerSavingD3;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:830:3: error: unknown type name 'UCHAR'
  830 |   UCHAR bSelfPowerSavingD3;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:831:3: error: unknown type name 'USHORT'
  831 |   USHORT TransitionTimeFromD1;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:832:3: error: unknown type name 'USHORT'
  832 |   USHORT TransitionTimeFromD2;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:833:3: error: unknown type name 'USHORT'
  833 |   USHORT TransitionTimeFromD3;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:156:9: error: unknown type name 'LONG'
  156 | typedef LONG USBD_STATUS;
      |         ^~~~
C:/msys64/mingw64/include/usb.h:223:9: error: unknown type name 'PVOID'
  223 | typedef PVOID USBD_PIPE_HANDLE;
      |         ^~~~~
C:/msys64/mingw64/include/usb.h:224:9: error: unknown type name 'PVOID'
  224 | typedef PVOID USBD_CONFIGURATION_HANDLE;
      |         ^~~~~
C:/msys64/mingw64/include/usb.h:225:9: error: unknown type name 'PVOID'
  225 | typedef PVOID USBD_INTERFACE_HANDLE;
      |         ^~~~~
C:/msys64/mingw64/include/usb.h:230:3: error: unknown type name 'ULONG'
  230 |   ULONG USBDI_Version;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:231:3: error: unknown type name 'ULONG'
  231 |   ULONG Supported_USB_Version;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:244:3: error: unknown type name 'ULONG'
  244 |   ULONG OffsetNext;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:245:3: error: unknown type name 'PVOID'
  245 |   PVOID UsbdDeviceHandle;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:250:3: error: unknown type name 'USHORT'
  250 |   USHORT MaximumPacketSize;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:251:3: error: unknown type name 'UCHAR'
  251 |   UCHAR EndpointAddress;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:252:3: error: unknown type name 'UCHAR'
  252 |   UCHAR Interval;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:255:3: error: unknown type name 'ULONG'
  255 |   ULONG MaximumTransferSize;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:256:3: error: unknown type name 'ULONG'
  256 |   ULONG PipeFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:266:3: error: unknown type name 'USHORT'
  266 |   USHORT Length;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:267:3: error: unknown type name 'UCHAR'
  267 |   UCHAR InterfaceNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:268:3: error: unknown type name 'UCHAR'
  268 |   UCHAR AlternateSetting;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:269:3: error: unknown type name 'UCHAR'
  269 |   UCHAR Class;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:270:3: error: unknown type name 'UCHAR'
  270 |   UCHAR SubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:271:3: error: unknown type name 'UCHAR'
  271 |   UCHAR Protocol;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:272:3: error: unknown type name 'UCHAR'
  272 |   UCHAR Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:274:3: error: unknown type name 'ULONG'
  274 |   ULONG NumberOfPipes;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:279:3: error: unknown type name 'PVOID'
  279 |   PVOID Reserved8[8];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:283:3: error: unknown type name 'USHORT'
  283 |   USHORT Length;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:284:3: error: unknown type name 'USHORT'
  284 |   USHORT Function;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:286:3: error: unknown type name 'PVOID'
  286 |   PVOID UsbdDeviceHandle;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:287:3: error: unknown type name 'ULONG'
  287 |   ULONG UsbdFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:306:3: error: unknown type name 'ULONG'
  306 |   ULONG Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:315:3: error: unknown type name 'ULONG'
  315 |   ULONG FrameLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:316:3: error: unknown type name 'ULONG'
  316 |   ULONG FrameNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:321:3: error: unknown type name 'LONG'
  321 |   LONG FrameLengthDelta;
      |   ^~~~
C:/msys64/mingw64/include/usb.h:326:3: error: unknown type name 'ULONG'
  326 |   ULONG FrameNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:331:3: error: unknown type name 'PVOID'
  331 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:332:3: error: unknown type name 'ULONG'
  332 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:333:3: error: unknown type name 'ULONG'
  333 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:334:3: error: unknown type name 'PVOID'
  334 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:338:3: error: unknown type name 'USHORT'
  338 |   USHORT Reserved1;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:339:3: error: unknown type name 'UCHAR'
  339 |   UCHAR Index;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:340:3: error: unknown type name 'UCHAR'
  340 |   UCHAR DescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:341:3: error: unknown type name 'USHORT'
  341 |   USHORT LanguageId;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:342:3: error: unknown type name 'USHORT'
  342 |   USHORT Reserved2;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:347:3: error: unknown type name 'PVOID'
  347 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:348:3: error: unknown type name 'ULONG'
  348 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:349:3: error: unknown type name 'ULONG'
  349 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:350:3: error: unknown type name 'PVOID'
  350 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:354:3: error: unknown type name 'UCHAR'
  354 |   UCHAR Reserved1[4];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:355:3: error: unknown type name 'USHORT'
  355 |   USHORT Index;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:356:3: error: unknown type name 'USHORT'
  356 |   USHORT Reserved2;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:361:3: error: unknown type name 'PVOID'
  361 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:362:3: error: unknown type name 'ULONG'
  362 |   ULONG Reserved2;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:363:3: error: unknown type name 'ULONG'
  363 |   ULONG Reserved3;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:364:3: error: unknown type name 'PVOID'
  364 |   PVOID Reserved4;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:368:3: error: unknown type name 'USHORT'
  368 |   USHORT Reserved0;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:369:3: error: unknown type name 'USHORT'
  369 |   USHORT FeatureSelector;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:370:3: error: unknown type name 'USHORT'
  370 |   USHORT Index;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:371:3: error: unknown type name 'USHORT'
  371 |   USHORT Reserved1;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:376:3: error: unknown type name 'PVOID'
  376 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:377:3: error: unknown type name 'ULONG'
  377 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:378:3: error: unknown type name 'ULONG'
  378 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:379:3: error: unknown type name 'PVOID'
  379 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:383:3: error: unknown type name 'UCHAR'
  383 |   UCHAR RequestTypeReservedBits;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:384:3: error: unknown type name 'UCHAR'
  384 |   UCHAR Request;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:385:3: error: unknown type name 'USHORT'
  385 |   USHORT Value;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:386:3: error: unknown type name 'USHORT'
  386 |   USHORT Index;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:387:3: error: unknown type name 'USHORT'
  387 |   USHORT Reserved1;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:392:3: error: unknown type name 'PVOID'
  392 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:393:3: error: unknown type name 'ULONG'
  393 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:394:3: error: unknown type name 'ULONG'
  394 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:395:3: error: unknown type name 'PVOID'
  395 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:399:3: error: unknown type name 'UCHAR'
  399 |   UCHAR Reserved1[4];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:400:3: error: unknown type name 'USHORT'
  400 |   USHORT Interface;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:401:3: error: unknown type name 'USHORT'
  401 |   USHORT Reserved2;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:406:3: error: unknown type name 'PVOID'
  406 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:407:3: error: unknown type name 'ULONG'
  407 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:408:3: error: unknown type name 'ULONG'
  408 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:409:3: error: unknown type name 'PVOID'
  409 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:413:3: error: unknown type name 'UCHAR'
  413 |   UCHAR Reserved1[8];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:426:3: error: unknown type name 'UCHAR'
  426 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:427:3: error: unknown type name 'UCHAR'
  427 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:428:3: error: unknown type name 'WCHAR'
  428 |   WCHAR MicrosoftString[7];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:429:3: error: unknown type name 'UCHAR'
  429 |   UCHAR bVendorCode;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:431:5: error: unknown type name 'UCHAR'
  431 |     UCHAR bPad;
      |     ^~~~~
C:/msys64/mingw64/include/usb.h:432:5: error: unknown type name 'UCHAR'
  432 |     UCHAR bFlags;
      |     ^~~~~
C:/msys64/mingw64/include/usb.h:438:3: error: unknown type name 'PVOID'
  438 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:439:3: error: unknown type name 'ULONG'
  439 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:440:3: error: unknown type name 'ULONG'
  440 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:441:3: error: unknown type name 'PVOID'
  441 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:445:3: error: unknown type name 'UCHAR'
  445 |   UCHAR Recipient:5;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:446:3: error: unknown type name 'UCHAR'
  446 |   UCHAR Reserved1:3;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:447:3: error: unknown type name 'UCHAR'
  447 |   UCHAR Reserved2;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:448:3: error: unknown type name 'UCHAR'
  448 |   UCHAR InterfaceNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:449:3: error: unknown type name 'UCHAR'
  449 |   UCHAR MS_PageIndex;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:450:3: error: unknown type name 'USHORT'
  450 |   USHORT MS_FeatureDescriptorIndex;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:451:3: error: unknown type name 'USHORT'
  451 |   USHORT Reserved3;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:457:3: error: unknown type name 'ULONG'
  457 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:458:3: error: unknown type name 'ULONG'
  458 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:459:3: error: unknown type name 'PVOID'
  459 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:463:3: error: unknown type name 'UCHAR'
  463 |   UCHAR SetupPacket[8];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:470:3: error: unknown type name 'ULONG'
  470 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:471:3: error: unknown type name 'ULONG'
  471 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:472:3: error: unknown type name 'PVOID'
  472 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:474:3: error: unknown type name 'ULONG'
  474 |   ULONG Timeout;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:476:3: error: unknown type name 'ULONG'
  476 |   ULONG Pad;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:479:3: error: unknown type name 'UCHAR'
  479 |   UCHAR SetupPacket[8];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:486:3: error: unknown type name 'ULONG'
  486 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:487:3: error: unknown type name 'ULONG'
  487 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:488:3: error: unknown type name 'PVOID'
  488 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:495:3: error: unknown type name 'ULONG'
  495 |   ULONG Offset;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:496:3: error: unknown type name 'ULONG'
  496 |   ULONG Length;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:503:3: error: unknown type name 'ULONG'
  503 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:504:3: error: unknown type name 'ULONG'
  504 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:505:3: error: unknown type name 'PVOID'
  505 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:509:3: error: unknown type name 'ULONG'
  509 |   ULONG StartFrame;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:510:3: error: unknown type name 'ULONG'
  510 |   ULONG NumberOfPackets;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:511:3: error: unknown type name 'ULONG'
  511 |   ULONG ErrorCount;
      |   ^~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:52:3: error: unknown type name 'usb_dev_handle'
   52 |   usb_dev_handle *dev_handle;
      |   ^~~~~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:53:32: error: field 'dev_desc' has incomplete type
   53 |   struct usb_device_descriptor dev_desc;
      |                                ^~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:54:32: error: field 'conf_desc' has incomplete type
   54 |   struct usb_config_descriptor conf_desc;
      |                                ^~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:55:35: error: field 'intf_desc' has incomplete type
   55 |   struct usb_interface_descriptor intf_desc;
      |                                   ^~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:56:34: error: field 'endp_desc' has incomplete type
   56 |   struct usb_endpoint_descriptor endp_desc;
      |                                  ^~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:96:30: error: unknown type name 'usb_dev_handle'
   96 | static char * get_usb_string(usb_dev_handle * dev_handle, int index);
      |                              ^~~~~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c: In function 'dfu_open':
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:148:3: warning: implicit declaration of function 'usb_init' [-Wimplicit-function-declaration]
  148 |   usb_init();
      |   ^~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:149:3: warning: implicit declaration of function 'usb_find_busses' [-Wimplicit-function-declaration]
  149 |   usb_find_busses();
      |   ^~~~~~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:150:3: warning: implicit declaration of function 'usb_find_devices' [-Wimplicit-function-declaration]
  150 |   usb_find_devices();
      |   ^~~~~~~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c: In function 'dfu_init':
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:185:14: error: 'usb_busses' undeclared (first use in this function); did you mean 'usb_bus'?
  185 |   for (bus = usb_busses; !found && bus != NULL; bus = bus->next) {
      |              ^~~~~~~~~~
      |              usb_bus
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:185:14: note: each undeclared identifier is reported only once for each function it appears in
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:185:58: error: invalid use of undefined type 'struct usb_bus'
  185 |   for (bus = usb_busses; !found && bus != NULL; bus = bus->next) {
      |                                                          ^~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:186:19: error: invalid use of undefined type 'struct usb_bus'
  186 |     for (dev = bus->devices; !found && dev != NULL; dev = dev->next) {
      |                   ^~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:186:62: error: invalid use of undefined type 'struct usb_device'
  186 |     for (dev = bus->devices; !found && dev != NULL; dev = dev->next) {
      |                                                              ^~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:187:47: error: invalid use of undefined type 'struct usb_bus'
  187 |       if (dfu->bus_name != NULL && !str_eq(bus->dirname, dfu->bus_name))
      |                                               ^~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:190:24: error: invalid use of undefined type 'struct usb_device'
  190 |         if (!str_eq(dev->filename, dfu->dev_name))
      |                        ^~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:192:28: error: invalid use of undefined type 'struct usb_device'
  192 |       } else if (vid != dev->descriptor.idVendor)
      |                            ^~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:194:38: error: invalid use of undefined type 'struct usb_device'
  194 |       else if (pid != 0 && pid != dev->descriptor.idProduct)
      |                                      ^~
In file included from C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:30:
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:211:10: error: invalid use of undefined type 'struct usb_device'
  211 |     found->descriptor.idVendor, found->descriptor.idProduct,
      |          ^~
C:/work/avr/avrdude_test/avrdude_jw/src/avrdude.h:79:122: note: in definition of macro 'pmsg_notice'
   79 | #define pmsg_notice(...)    avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FLUSH, MSG_NOTICE, __VA_ARGS__)
      |                                                                                                                          ^~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:211:38: error: invalid use of undefined type 'struct usb_device'
  211 |     found->descriptor.idVendor, found->descriptor.idProduct,
      |                                      ^~
C:/work/avr/avrdude_test/avrdude_jw/src/avrdude.h:79:122: note: in definition of macro 'pmsg_notice'
   79 | #define pmsg_notice(...)    avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FLUSH, MSG_NOTICE, __VA_ARGS__)
      |                                                                                                                          ^~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:212:10: error: invalid use of undefined type 'struct usb_device'
  212 |     found->bus->dirname, found->filename);
      |          ^~
C:/work/avr/avrdude_test/avrdude_jw/src/avrdude.h:79:122: note: in definition of macro 'pmsg_notice'
   79 | #define pmsg_notice(...)    avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FLUSH, MSG_NOTICE, __VA_ARGS__)
      |                                                                                                                          ^~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:212:31: error: invalid use of undefined type 'struct usb_device'
  212 |     found->bus->dirname, found->filename);
      |                               ^~
C:/work/avr/avrdude_test/avrdude_jw/src/avrdude.h:79:122: note: in definition of macro 'pmsg_notice'
   79 | #define pmsg_notice(...)    avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FLUSH, MSG_NOTICE, __VA_ARGS__)
      |                                                                                                                          ^~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:214:21: warning: implicit declaration of function 'usb_open' [-Wimplicit-function-declaration]
  214 |   dfu->dev_handle = usb_open(found);
      |                     ^~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:214:19: warning: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  214 |   dfu->dev_handle = usb_open(found);
      |                   ^
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:217:50: error: invalid use of undefined type 'struct usb_device'
  217 |     pmsg_error("USB device at %s:%s: %s\n", found->bus->dirname, found->filename, usb_strerror());
      |                                                  ^~
C:/work/avr/avrdude_test/avrdude_jw/src/avrdude.h:76:159: note: in definition of macro 'pmsg_error'
   76 | #define pmsg_error(...)     avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FUNCTION|MSG2_FILELINE|MSG2_TYPE|MSG2_FLUSH, MSG_ERROR, __VA_ARGS__)
      |
            ^~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:217:71: error: invalid use of undefined type 'struct usb_device'
  217 |     pmsg_error("USB device at %s:%s: %s\n", found->bus->dirname, found->filename, usb_strerror());
      |                                                                       ^~
C:/work/avr/avrdude_test/avrdude_jw/src/avrdude.h:76:159: note: in definition of macro 'pmsg_error'
   76 | #define pmsg_error(...)     avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FUNCTION|MSG2_FILELINE|MSG2_TYPE|MSG2_FLUSH, MSG_ERROR, __VA_ARGS__)
      |
            ^~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:217:83: warning: implicit declaration of function 'usb_strerror'; did you mean '_strerror'? [-Wimplicit-function-declaration]
  217 |     pmsg_error("USB device at %s:%s: %s\n", found->bus->dirname, found->filename, usb_strerror());
      |                                                                                   ^~~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/avrdude.h:76:159: note: in definition of macro 'pmsg_error'
   76 | #define pmsg_error(...)     avrdude_message2(stderr, __LINE__, __FILE__, __func__, MSG2_PROGNAME|MSG2_FUNCTION|MSG2_FILELINE|MSG2_TYPE|MSG2_FLUSH, MSG_ERROR, __VA_ARGS__)
      |
            ^~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:223:32: error: invalid use of undefined type 'struct usb_device'
  223 |   memcpy(&dfu->dev_desc, &found->descriptor, sizeof(dfu->dev_desc));
      |                                ^~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:224:32: error: invalid use of undefined type 'struct usb_device'
  224 |   memcpy(&dfu->conf_desc, found->config, sizeof(dfu->conf_desc));
      |                                ^~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:227:32: error: invalid use of undefined type 'struct usb_device'
  227 |   memcpy(&dfu->intf_desc, found->config->interface->altsetting,
      |                                ^~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:231:12: error: invalid use of undefined type 'struct usb_device'
  231 |   if (found->config->interface->altsetting->endpoint != 0)
      |            ^~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:232:36: error: invalid use of undefined type 'struct usb_device'
  232 |       memcpy(&dfu->endp_desc, found->config->interface->altsetting->endpoint,
      |                                    ^~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:237:19: warning: implicit declaration of function 'get_usb_string' [-Wimplicit-function-declaration]
  237 |   dfu->manf_str = get_usb_string(dfu->dev_handle,
      |                   ^~~~~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c: In function 'dfu_close':
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:252:5: warning: implicit declaration of function 'usb_close'; did you mean 'dfu_close'? [-Wimplicit-function-declaration]
  252 |     usb_close(dfu->dev_handle);
      |     ^~~~~~~~~
      |     dfu_close
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c: In function 'dfu_getstatus':
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:269:12: warning: implicit declaration of function 'usb_control_msg' [-Wimplicit-function-declaration]
  269 |   result = usb_control_msg(dfu->dev_handle,
      |            ^~~~~~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:270:12: error: 'USB_TYPE_CLASS' undeclared (first use in this function)
  270 |     0x80 | USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_GETSTATUS, 0, 0,
      |            ^~~~~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:270:29: error: 'USB_RECIP_INTERFACE' undeclared (first use in this function); did you mean 'USB_REQUEST_SET_INTERFACE'?
  270 |     0x80 | USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_GETSTATUS, 0, 0,
      |                             ^~~~~~~~~~~~~~~~~~~
      |                             USB_REQUEST_SET_INTERFACE
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c: In function 'dfu_clrstatus':
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:304:5: error: 'USB_TYPE_CLASS' undeclared (first use in this function)
  304 |     USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_CLRSTATUS, 0, 0,
      |     ^~~~~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:304:22: error: 'USB_RECIP_INTERFACE' undeclared (first use in this function); did you mean 'USB_REQUEST_SET_INTERFACE'?
  304 |     USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_CLRSTATUS, 0, 0,
      |                      ^~~~~~~~~~~~~~~~~~~
      |                      USB_REQUEST_SET_INTERFACE
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c: In function 'dfu_abort':
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:322:5: error: 'USB_TYPE_CLASS' undeclared (first use in this function)
  322 |     USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_ABORT, 0, 0,
      |     ^~~~~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:322:22: error: 'USB_RECIP_INTERFACE' undeclared (first use in this function); did you mean 'USB_REQUEST_SET_INTERFACE'?
  322 |     USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_ABORT, 0, 0,
      |                      ^~~~~~~~~~~~~~~~~~~
      |                      USB_REQUEST_SET_INTERFACE
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c: In function 'dfu_dnload':
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:342:5: error: 'USB_TYPE_CLASS' undeclared (first use in this function)
  342 |     USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_DNLOAD, wIndex++, 0,
      |     ^~~~~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:342:22: error: 'USB_RECIP_INTERFACE' undeclared (first use in this function); did you mean 'USB_REQUEST_SET_INTERFACE'?
  342 |     USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_DNLOAD, wIndex++, 0,
      |                      ^~~~~~~~~~~~~~~~~~~
      |                      USB_REQUEST_SET_INTERFACE
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c: In function 'dfu_upload':
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:371:12: error: 'USB_TYPE_CLASS' undeclared (first use in this function)
  371 |     0x80 | USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_UPLOAD, wIndex++, 0,
      |            ^~~~~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:371:29: error: 'USB_RECIP_INTERFACE' undeclared (first use in this function); did you mean 'USB_REQUEST_SET_INTERFACE'?
  371 |     0x80 | USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_UPLOAD, wIndex++, 0,
      |                             ^~~~~~~~~~~~~~~~~~~
      |                             USB_REQUEST_SET_INTERFACE
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c: At top level:
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.c:420:23: error: unknown type name 'usb_dev_handle'
  420 | char * get_usb_string(usb_dev_handle * dev_handle, int index) {
      |                       ^~~~~~~~~~~~~~
[92/148] Building C object src/CMakeFiles/swig_avrdude.dir/flip1.c.obj
FAILED: src/CMakeFiles/swig_avrdude.dir/flip1.c.obj
C:\msys64\mingw64\bin\cc.exe -DCONFIG_DIR="\"C:/Program Files (x86)/avrdude/etc\"" -Dswig_avrdude_EXPORTS -IC:/work/avr/avrdude_test/avrdude_jw/build_mingw64_nt-10.0-19045/src -IC:/msys64/mingw64/include/python3.11 -IC:/work/avr/avrdude_test/avrdude_jw/src -IC:/work/avr/avrdude_test/avrdude_jw/build_mingw64_nt-10.0-19045/src/.. -O2 -g -DNDEBUG -std=gnu11 -Wall -Wextra -Wno-unused-parameter -MD -MT src/CMakeFiles/swig_avrdude.dir/flip1.c.obj -MF src\CMakeFiles\swig_avrdude.dir\flip1.c.obj.d -o src/CMakeFiles/swig_avrdude.dir/flip1.c.obj -c C:/work/avr/avrdude_test/avrdude_jw/src/flip1.c
In file included from C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:28,
                 from C:/work/avr/avrdude_test/avrdude_jw/src/flip1.c:38:
C:/msys64/mingw64/include/usb.h:27:9: error: unknown type name 'PVOID'
   27 | typedef PVOID PIRP;
      |         ^~~~~
C:/msys64/mingw64/include/usb.h:28:9: error: unknown type name 'PVOID'
   28 | typedef PVOID PMDL;
      |         ^~~~~
In file included from C:/msys64/mingw64/include/usb.h:34:
C:/msys64/mingw64/include/usbspec.h:28:5: error: unknown type name 'UCHAR'
   28 |     UCHAR Recipient:2;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:29:5: error: unknown type name 'UCHAR'
   29 |     UCHAR Reserved:3;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:30:5: error: unknown type name 'UCHAR'
   30 |     UCHAR Type:2;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:31:5: error: unknown type name 'UCHAR'
   31 |     UCHAR Dir:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:33:3: error: unknown type name 'UCHAR'
   33 |   UCHAR B;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:38:3: error: unknown type name 'UCHAR'
   38 |   UCHAR bRequest;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:41:7: error: unknown type name 'UCHAR'
   41 |       UCHAR LowByte;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:42:7: error: unknown type name 'UCHAR'
   42 |       UCHAR HiByte;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:44:5: error: unknown type name 'USHORT'
   44 |     USHORT W;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:48:7: error: unknown type name 'UCHAR'
   48 |       UCHAR LowByte;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:49:7: error: unknown type name 'UCHAR'
   49 |       UCHAR HiByte;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:51:5: error: unknown type name 'USHORT'
   51 |     USHORT W;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:53:3: error: unknown type name 'USHORT'
   53 |   USHORT wLength;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:136:3: error: unknown type name 'USHORT'
  136 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:138:5: error: unknown type name 'USHORT'
  138 |     USHORT SelfPowered : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:139:5: error: unknown type name 'USHORT'
  139 |     USHORT RemoteWakeup : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:140:5: error: unknown type name 'USHORT'
  140 |     USHORT U1Enable : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:141:5: error: unknown type name 'USHORT'
  141 |     USHORT U2Enable : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:142:5: error: unknown type name 'USHORT'
  142 |     USHORT LtmEnable : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:143:5: error: unknown type name 'USHORT'
  143 |     USHORT Reserved : 11;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:148:3: error: unknown type name 'USHORT'
  148 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:150:5: error: unknown type name 'USHORT'
  150 |     USHORT RemoteWakeupCapable : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:151:5: error: unknown type name 'USHORT'
  151 |     USHORT RemoteWakeupEnabled : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:152:5: error: unknown type name 'USHORT'
  152 |     USHORT Reserved : 14;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:157:3: error: unknown type name 'USHORT'
  157 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:159:5: error: unknown type name 'USHORT'
  159 |     USHORT Halt : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:160:5: error: unknown type name 'USHORT'
  160 |     USHORT Reserved : 15;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:165:3: error: unknown type name 'UCHAR'
  165 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:166:3: error: unknown type name 'UCHAR'
  166 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:170:3: error: unknown type name 'UCHAR'
  170 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:171:3: error: unknown type name 'UCHAR'
  171 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:172:3: error: unknown type name 'USHORT'
  172 |   USHORT bcdUSB;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:173:3: error: unknown type name 'UCHAR'
  173 |   UCHAR bDeviceClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:174:3: error: unknown type name 'UCHAR'
  174 |   UCHAR bDeviceSubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:175:3: error: unknown type name 'UCHAR'
  175 |   UCHAR bDeviceProtocol;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:176:3: error: unknown type name 'UCHAR'
  176 |   UCHAR bMaxPacketSize0;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:177:3: error: unknown type name 'USHORT'
  177 |   USHORT idVendor;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:178:3: error: unknown type name 'USHORT'
  178 |   USHORT idProduct;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:179:3: error: unknown type name 'USHORT'
  179 |   USHORT bcdDevice;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:180:3: error: unknown type name 'UCHAR'
  180 |   UCHAR iManufacturer;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:181:3: error: unknown type name 'UCHAR'
  181 |   UCHAR iProduct;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:182:3: error: unknown type name 'UCHAR'
  182 |   UCHAR iSerialNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:183:3: error: unknown type name 'UCHAR'
  183 |   UCHAR bNumConfigurations;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:211:3: error: unknown type name 'UCHAR'
  211 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:212:3: error: unknown type name 'UCHAR'
  212 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:213:3: error: unknown type name 'USHORT'
  213 |   USHORT bcdUSB;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:214:3: error: unknown type name 'UCHAR'
  214 |   UCHAR bDeviceClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:215:3: error: unknown type name 'UCHAR'
  215 |   UCHAR bDeviceSubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:216:3: error: unknown type name 'UCHAR'
  216 |   UCHAR bDeviceProtocol;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:217:3: error: unknown type name 'UCHAR'
  217 |   UCHAR bMaxPacketSize0;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:218:3: error: unknown type name 'UCHAR'
  218 |   UCHAR bNumConfigurations;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:219:3: error: unknown type name 'UCHAR'
  219 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:223:3: error: unknown type name 'UCHAR'
  223 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:224:3: error: unknown type name 'UCHAR'
  224 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:225:3: error: unknown type name 'USHORT'
  225 |   USHORT wTotalLength;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:226:3: error: unknown type name 'UCHAR'
  226 |   UCHAR bNumDeviceCaps;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:243:3: error: unknown type name 'UCHAR'
  243 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:244:3: error: unknown type name 'UCHAR'
  244 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:245:3: error: unknown type name 'UCHAR'
  245 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:247:5: error: unknown type name 'ULONG'
  247 |     ULONG AsUlong;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:249:7: error: unknown type name 'ULONG'
  249 |       ULONG Reserved:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:250:7: error: unknown type name 'ULONG'
  250 |       ULONG LPMCapable:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:251:7: error: unknown type name 'ULONG'
  251 |       ULONG BESLAndAlternateHIRDSupported:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:252:7: error: unknown type name 'ULONG'
  252 |       ULONG BaselineBESLValid:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:253:7: error: unknown type name 'ULONG'
  253 |       ULONG DeepBESLValid:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:254:7: error: unknown type name 'ULONG'
  254 |       ULONG Reserved1:3;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:255:7: error: unknown type name 'ULONG'
  255 |       ULONG BaselineBESL:4;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:256:7: error: unknown type name 'ULONG'
  256 |       ULONG DeepBESL:4;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:257:7: error: unknown type name 'ULONG'
  257 |       ULONG Reserved2:16;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:265:3: error: unknown type name 'UCHAR'
  265 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:266:3: error: unknown type name 'UCHAR'
  266 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:267:3: error: unknown type name 'UCHAR'
  267 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:268:3: error: unknown type name 'UCHAR'
  268 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:270:5: error: unknown type name 'ULONG'
  270 |     ULONG AsUlong;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:272:7: error: unknown type name 'ULONG'
  272 |       ULONG Reserved1:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:273:7: error: unknown type name 'ULONG'
  273 |       ULONG BatteryCharging:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:274:7: error: unknown type name 'ULONG'
  274 |       ULONG USBPowerDelivery:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:275:7: error: unknown type name 'ULONG'
  275 |       ULONG Provider:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:276:7: error: unknown type name 'ULONG'
  276 |       ULONG Consumer:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:277:7: error: unknown type name 'ULONG'
  277 |       ULONG ChargingPolicy:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:278:7: error: unknown type name 'ULONG'
  278 |       ULONG TypeCCurrent:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:279:7: error: unknown type name 'ULONG'
  279 |       ULONG Reserved2:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:280:7: error: unknown type name 'ULONG'
  280 |       ULONG ACSupply:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:281:7: error: unknown type name 'ULONG'
  281 |       ULONG Battery:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:282:7: error: unknown type name 'ULONG'
  282 |       ULONG Other:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:283:7: error: unknown type name 'ULONG'
  283 |       ULONG NumBatteries:3;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:284:7: error: unknown type name 'ULONG'
  284 |       ULONG UsesVbus:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:285:7: error: unknown type name 'ULONG'
  285 |       ULONG Reserved3:17;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:288:3: error: unknown type name 'USHORT'
  288 |   USHORT bmProviderPorts;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:289:3: error: unknown type name 'USHORT'
  289 |   USHORT bmConsumerPorts;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:290:3: error: unknown type name 'USHORT'
  290 |   USHORT bcdBCVersion;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:291:3: error: unknown type name 'USHORT'
  291 |   USHORT bcdPDVersion;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:292:3: error: unknown type name 'USHORT'
  292 |   USHORT bcdUSBTypeCVersion;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:296:3: error: unknown type name 'UCHAR'
  296 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:297:3: error: unknown type name 'UCHAR'
  297 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:298:3: error: unknown type name 'UCHAR'
  298 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:299:3: error: unknown type name 'UCHAR'
  299 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:301:5: error: unknown type name 'USHORT'
  301 |     USHORT AsUshort;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:303:9: error: unknown type name 'USHORT'
  303 |         USHORT BatteryCharging:1;
      |         ^~~~~~
C:/msys64/mingw64/include/usbspec.h:304:9: error: unknown type name 'USHORT'
  304 |         USHORT USBPowerDelivery:1;
      |         ^~~~~~
C:/msys64/mingw64/include/usbspec.h:305:9: error: unknown type name 'USHORT'
  305 |         USHORT USBTypeCCurrent:1;
      |         ^~~~~~
C:/msys64/mingw64/include/usbspec.h:306:9: error: unknown type name 'USHORT'
  306 |         USHORT Reserved:13;
      |         ^~~~~~
C:/msys64/mingw64/include/usbspec.h:309:3: error: unknown type name 'USHORT'
  309 |   USHORT wMinVoltage;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:310:3: error: unknown type name 'USHORT'
  310 |   USHORT wMaxVoltage;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:311:3: error: unknown type name 'USHORT'
  311 |   USHORT wReserved;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:312:3: error: unknown type name 'ULONG'
  312 |   ULONG dwMaxOperatingPower;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:313:3: error: unknown type name 'ULONG'
  313 |   ULONG dwMaxPeakPower;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:314:3: error: unknown type name 'ULONG'
  314 |   ULONG dwMaxPeakPowerTime;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:318:3: error: unknown type name 'UCHAR'
  318 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:319:3: error: unknown type name 'UCHAR'
  319 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:320:3: error: unknown type name 'UCHAR'
  320 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:321:3: error: unknown type name 'UCHAR'
  321 |   UCHAR bmAttributes;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:322:3: error: unknown type name 'USHORT'
  322 |   USHORT wSpeedsSupported;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:323:3: error: unknown type name 'UCHAR'
  323 |   UCHAR bFunctionalitySupport;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:324:3: error: unknown type name 'UCHAR'
  324 |   UCHAR bU1DevExitLat;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:325:3: error: unknown type name 'USHORT'
  325 |   USHORT wU2DevExitLat;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:363:3: error: unknown type name 'ULONG'
  363 |   ULONG AsUlong32;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:365:5: error: unknown type name 'ULONG'
  365 |     ULONG SublinkSpeedAttrID:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:366:5: error: unknown type name 'ULONG'
  366 |     ULONG LaneSpeedExponent:2;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:367:5: error: unknown type name 'ULONG'
  367 |     ULONG SublinkTypeMode:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:368:5: error: unknown type name 'ULONG'
  368 |     ULONG SublinkTypeDir:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:369:5: error: unknown type name 'ULONG'
  369 |     ULONG Reserved:6;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:370:5: error: unknown type name 'ULONG'
  370 |     ULONG LinkProtocol:2;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:371:5: error: unknown type name 'ULONG'
  371 |     ULONG LaneSpeedMantissa:16;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:376:3: error: unknown type name 'UCHAR'
  376 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:377:3: error: unknown type name 'UCHAR'
  377 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:378:3: error: unknown type name 'UCHAR'
  378 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:379:3: error: unknown type name 'UCHAR'
  379 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:381:5: error: unknown type name 'ULONG'
  381 |     ULONG AsUlong;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:383:7: error: unknown type name 'ULONG'
  383 |       ULONG SublinkSpeedAttrCount:5;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:384:7: error: unknown type name 'ULONG'
  384 |       ULONG SublinkSpeedIDCount:4;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:385:7: error: unknown type name 'ULONG'
  385 |       ULONG Reserved:23;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:389:5: error: unknown type name 'USHORT'
  389 |     USHORT AsUshort;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:391:7: error: unknown type name 'USHORT'
  391 |       USHORT SublinkSpeedAttrID:4;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:392:7: error: unknown type name 'USHORT'
  392 |       USHORT Reserved:4;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:393:7: error: unknown type name 'USHORT'
  393 |       USHORT MinRxLaneCount:4;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:394:7: error: unknown type name 'USHORT'
  394 |       USHORT MinTxLaneCount:4;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:397:3: error: unknown type name 'USHORT'
  397 |   USHORT wReserved;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:402:3: error: unknown type name 'UCHAR'
  402 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:403:3: error: unknown type name 'UCHAR'
  403 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:404:3: error: unknown type name 'UCHAR'
  404 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:405:3: error: unknown type name 'UCHAR'
  405 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:406:3: error: unknown type name 'UCHAR'
  406 |   UCHAR ContainerID[16];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:410:3: error: unknown type name 'UCHAR'
  410 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:411:3: error: unknown type name 'UCHAR'
  411 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:412:3: error: unknown type name 'UCHAR'
  412 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:413:3: error: unknown type name 'UCHAR'
  413 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:414:3: error: unknown type name 'GUID'
  414 |   GUID PlatformCapabilityUuid;
      |   ^~~~
C:/msys64/mingw64/include/usbspec.h:415:3: error: unknown type name 'UCHAR'
  415 |   UCHAR CapabililityData[1];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:419:3: error: unknown type name 'UCHAR'
  419 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:420:3: error: unknown type name 'UCHAR'
  420 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:421:3: error: unknown type name 'UCHAR'
  421 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:422:3: error: unknown type name 'UCHAR'
  422 |   UCHAR iAddtionalInfoURL;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:423:3: error: unknown type name 'UCHAR'
  423 |   UCHAR bNumberOfAlternateModes;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:424:3: error: unknown type name 'UCHAR'
  424 |   UCHAR bPreferredAlternateMode;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:426:5: error: unknown type name 'USHORT'
  426 |     USHORT AsUshort;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:428:7: error: unknown type name 'USHORT'
  428 |       USHORT VConnPowerNeededForFullFunctionality:3;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:429:7: error: unknown type name 'USHORT'
  429 |       USHORT Reserved:12;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:430:7: error: unknown type name 'USHORT'
  430 |       USHORT NoVconnPowerRequired:1;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:433:3: error: unknown type name 'UCHAR'
  433 |   UCHAR bmConfigured[32];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:434:3: error: unknown type name 'ULONG'
  434 |   ULONG bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:436:5: error: unknown type name 'USHORT'
  436 |     USHORT wSVID;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:437:5: error: unknown type name 'UCHAR'
  437 |     UCHAR bAlternateMode;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:438:5: error: unknown type name 'UCHAR'
  438 |     UCHAR iAlternateModeSetting;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:442:52: error: expected ')' before numeric constant
  442 | DEFINE_GUID(GUID_USB_MSOS20_PLATFORM_CAPABILITY_ID, 0xD8DD60DF, 0x4589, 0x4CC7, 0x9C, 0xD2, 0x65, 0x9D, 0x9E, 0x64, 0x8A, 0x9F);
      |                                                    ^~~~~~~~~~~
      |                                                    )
C:/msys64/mingw64/include/usbspec.h:445:3: error: unknown type name 'UCHAR'
  445 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:446:3: error: unknown type name 'UCHAR'
  446 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:447:3: error: unknown type name 'UCHAR'
  447 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:451:3: error: unknown type name 'UCHAR'
  451 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:452:3: error: unknown type name 'UCHAR'
  452 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:453:3: error: unknown type name 'USHORT'
  453 |   USHORT wTotalLength;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:454:3: error: unknown type name 'UCHAR'
  454 |   UCHAR bNumInterfaces;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:455:3: error: unknown type name 'UCHAR'
  455 |   UCHAR bConfigurationValue;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:456:3: error: unknown type name 'UCHAR'
  456 |   UCHAR iConfiguration;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:457:3: error: unknown type name 'UCHAR'
  457 |   UCHAR bmAttributes;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:458:3: error: unknown type name 'UCHAR'
  458 |   UCHAR MaxPower;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:468:3: error: unknown type name 'UCHAR'
  468 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:469:3: error: unknown type name 'UCHAR'
  469 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:470:3: error: unknown type name 'UCHAR'
  470 |   UCHAR bFirstInterface;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:471:3: error: unknown type name 'UCHAR'
  471 |   UCHAR bInterfaceCount;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:472:3: error: unknown type name 'UCHAR'
  472 |   UCHAR bFunctionClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:473:3: error: unknown type name 'UCHAR'
  473 |   UCHAR bFunctionSubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:474:3: error: unknown type name 'UCHAR'
  474 |   UCHAR bFunctionProtocol;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:475:3: error: unknown type name 'UCHAR'
  475 |   UCHAR iFunction;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:479:3: error: unknown type name 'UCHAR'
  479 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:480:3: error: unknown type name 'UCHAR'
  480 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:481:3: error: unknown type name 'UCHAR'
  481 |   UCHAR bInterfaceNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:482:3: error: unknown type name 'UCHAR'
  482 |   UCHAR bAlternateSetting;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:483:3: error: unknown type name 'UCHAR'
  483 |   UCHAR bNumEndpoints;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:484:3: error: unknown type name 'UCHAR'
  484 |   UCHAR bInterfaceClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:485:3: error: unknown type name 'UCHAR'
  485 |   UCHAR bInterfaceSubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:486:3: error: unknown type name 'UCHAR'
  486 |   UCHAR bInterfaceProtocol;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:487:3: error: unknown type name 'UCHAR'
  487 |   UCHAR iInterface;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:491:3: error: unknown type name 'UCHAR'
  491 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:492:3: error: unknown type name 'UCHAR'
  492 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:493:3: error: unknown type name 'UCHAR'
  493 |   UCHAR bEndpointAddress;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:494:3: error: unknown type name 'UCHAR'
  494 |   UCHAR bmAttributes;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:495:3: error: unknown type name 'USHORT'
  495 |   USHORT wMaxPacketSize;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:496:3: error: unknown type name 'UCHAR'
  496 |   UCHAR bInterval;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:540:5: error: unknown type name 'USHORT'
  540 |     USHORT MaxPacket : 11;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:541:5: error: unknown type name 'USHORT'
  541 |     USHORT HSmux : 2;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:542:5: error: unknown type name 'USHORT'
  542 |     USHORT Reserved : 3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:544:3: error: unknown type name 'USHORT'
  544 |   USHORT us;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:553:3: error: unknown type name 'UCHAR'
  553 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:554:3: error: unknown type name 'UCHAR'
  554 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:555:3: error: unknown type name 'WCHAR'
  555 |   WCHAR bString[1];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:561:3: error: unknown type name 'UCHAR'
  561 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:562:3: error: unknown type name 'UCHAR'
  562 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:563:3: error: unknown type name 'UCHAR'
  563 |   UCHAR bMaxBurst;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:565:5: error: unknown type name 'UCHAR'
  565 |     UCHAR AsUchar;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:567:7: error: unknown type name 'UCHAR'
  567 |       UCHAR MaxStreams:5;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:568:7: error: unknown type name 'UCHAR'
  568 |       UCHAR Reserved1:3;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:571:7: error: unknown type name 'UCHAR'
  571 |       UCHAR Mult:2;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:572:7: error: unknown type name 'UCHAR'
  572 |       UCHAR Reserved2:5;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:573:7: error: unknown type name 'UCHAR'
  573 |       UCHAR SspCompanion:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:576:3: error: unknown type name 'USHORT'
  576 |   USHORT wBytesPerInterval;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:582:3: error: unknown type name 'UCHAR'
  582 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:583:3: error: unknown type name 'UCHAR'
  583 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:584:3: error: unknown type name 'USHORT'
  584 |   USHORT wReserved;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:585:3: error: unknown type name 'ULONG'
  585 |   ULONG dwBytesPerInterval;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:592:3: error: unknown type name 'UCHAR'
  592 |   UCHAR bDescriptorLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:593:3: error: unknown type name 'UCHAR'
  593 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:594:3: error: unknown type name 'UCHAR'
  594 |   UCHAR bNumberOfPorts;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:595:3: error: unknown type name 'USHORT'
  595 |   USHORT wHubCharacteristics;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:596:3: error: unknown type name 'UCHAR'
  596 |   UCHAR bPowerOnToPowerGood;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:597:3: error: unknown type name 'UCHAR'
  597 |   UCHAR bHubControlCurrent;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:598:3: error: unknown type name 'UCHAR'
  598 |   UCHAR bRemoveAndPowerMask[64];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:604:3: error: unknown type name 'UCHAR'
  604 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:605:3: error: unknown type name 'UCHAR'
  605 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:606:3: error: unknown type name 'UCHAR'
  606 |   UCHAR bNumberOfPorts;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:607:3: error: unknown type name 'USHORT'
  607 |   USHORT wHubCharacteristics;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:608:3: error: unknown type name 'UCHAR'
  608 |   UCHAR bPowerOnToPowerGood;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:609:3: error: unknown type name 'UCHAR'
  609 |   UCHAR bHubControlCurrent;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:610:3: error: unknown type name 'UCHAR'
  610 |   UCHAR bHubHdrDecLat;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:611:3: error: unknown type name 'USHORT'
  611 |   USHORT wHubDelay;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:612:3: error: unknown type name 'USHORT'
  612 |   USHORT DeviceRemovable;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:628:3: error: unknown type name 'USHORT'
  628 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:630:5: error: unknown type name 'USHORT'
  630 |     USHORT LocalPowerLost:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:631:5: error: unknown type name 'USHORT'
  631 |     USHORT OverCurrent:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:632:5: error: unknown type name 'USHORT'
  632 |     USHORT Reserved:14;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:637:3: error: unknown type name 'USHORT'
  637 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:639:5: error: unknown type name 'USHORT'
  639 |     USHORT LocalPowerChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:640:5: error: unknown type name 'USHORT'
  640 |     USHORT OverCurrentChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:641:5: error: unknown type name 'USHORT'
  641 |     USHORT Reserved:14;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:646:3: error: unknown type name 'ULONG'
  646 |   ULONG AsUlong32;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:654:3: error: unknown type name 'USHORT'
  654 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:656:5: error: unknown type name 'USHORT'
  656 |     USHORT CurrentConnectStatus:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:657:5: error: unknown type name 'USHORT'
  657 |     USHORT PortEnabledDisabled:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:658:5: error: unknown type name 'USHORT'
  658 |     USHORT Suspend:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:659:5: error: unknown type name 'USHORT'
  659 |     USHORT OverCurrent:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:660:5: error: unknown type name 'USHORT'
  660 |     USHORT Reset:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:661:5: error: unknown type name 'USHORT'
  661 |     USHORT Reserved0:3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:662:5: error: unknown type name 'USHORT'
  662 |     USHORT PortPower:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:663:5: error: unknown type name 'USHORT'
  663 |     USHORT LowSpeedDeviceAttached:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:664:5: error: unknown type name 'USHORT'
  664 |     USHORT HighSpeedDeviceAttached:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:665:5: error: unknown type name 'USHORT'
  665 |     USHORT PortTestMode:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:666:5: error: unknown type name 'USHORT'
  666 |     USHORT PortIndicatorControl:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:667:5: error: unknown type name 'USHORT'
  667 |     USHORT Reserved1:3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:681:3: error: unknown type name 'USHORT'
  681 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:683:5: error: unknown type name 'USHORT'
  683 |     USHORT ConnectStatusChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:684:5: error: unknown type name 'USHORT'
  684 |     USHORT PortEnableDisableChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:685:5: error: unknown type name 'USHORT'
  685 |     USHORT SuspendChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:686:5: error: unknown type name 'USHORT'
  686 |     USHORT OverCurrentIndicatorChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:687:5: error: unknown type name 'USHORT'
  687 |     USHORT ResetChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:688:5: error: unknown type name 'USHORT'
  688 |     USHORT Reserved2:11;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:693:3: error: unknown type name 'USHORT'
  693 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:695:5: error: unknown type name 'USHORT'
  695 |     USHORT CurrentConnectStatus:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:696:5: error: unknown type name 'USHORT'
  696 |     USHORT PortEnabledDisabled:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:697:5: error: unknown type name 'USHORT'
  697 |     USHORT Reserved0:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:698:5: error: unknown type name 'USHORT'
  698 |     USHORT OverCurrent:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:699:5: error: unknown type name 'USHORT'
  699 |     USHORT Reset:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:700:5: error: unknown type name 'USHORT'
  700 |     USHORT PortLinkState:4;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:701:5: error: unknown type name 'USHORT'
  701 |     USHORT PortPower:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:702:5: error: unknown type name 'USHORT'
  702 |     USHORT NegotiatedDeviceSpeed:3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:703:5: error: unknown type name 'USHORT'
  703 |     USHORT Reserved1:3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:722:3: error: unknown type name 'USHORT'
  722 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:724:5: error: unknown type name 'USHORT'
  724 |     USHORT ConnectStatusChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:725:5: error: unknown type name 'USHORT'
  725 |     USHORT Reserved2:2;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:726:5: error: unknown type name 'USHORT'
  726 |     USHORT OverCurrentIndicatorChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:727:5: error: unknown type name 'USHORT'
  727 |     USHORT ResetChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:728:5: error: unknown type name 'USHORT'
  728 |     USHORT BHResetChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:729:5: error: unknown type name 'USHORT'
  729 |     USHORT PortLinkStateChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:730:5: error: unknown type name 'USHORT'
  730 |     USHORT PortConfigErrorChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:731:5: error: unknown type name 'USHORT'
  731 |     USHORT Reserved3:8;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:736:3: error: unknown type name 'USHORT'
  736 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:742:3: error: unknown type name 'USHORT'
  742 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:748:3: error: unknown type name 'ULONG'
  748 |   ULONG AsUlong32;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:750:5: error: unknown type name 'ULONG'
  750 |     ULONG RxSublinkSpeedID:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:751:5: error: unknown type name 'ULONG'
  751 |     ULONG TxSublinkSpeedID:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:752:5: error: unknown type name 'ULONG'
  752 |     ULONG RxLaneCount:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:753:5: error: unknown type name 'ULONG'
  753 |     ULONG TxLaneCount:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:754:5: error: unknown type name 'ULONG'
  754 |     ULONG Reserved:16;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:759:3: error: unknown type name 'ULONG'
  759 |   ULONG AsUlong32;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:767:3: error: unknown type name 'ULONG64'
  767 |   ULONG64 AsUlong64;
      |   ^~~~~~~
C:/msys64/mingw64/include/usbspec.h:775:3: error: unknown type name 'UCHAR'
  775 |   UCHAR AsUchar8;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:777:5: error: unknown type name 'UCHAR'
  777 |     UCHAR ConnectRemoteWakeEnable:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:778:5: error: unknown type name 'UCHAR'
  778 |     UCHAR DisconnectRemoteWakeEnable:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:779:5: error: unknown type name 'UCHAR'
  779 |     UCHAR OverCurrentRemoteWakeEnable:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:780:5: error: unknown type name 'UCHAR'
  780 |     UCHAR Reserved0:5;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:785:3: error: unknown type name 'UCHAR'
  785 |   UCHAR AsUchar;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:787:5: error: unknown type name 'UCHAR'
  787 |     UCHAR PowerState:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:788:5: error: unknown type name 'UCHAR'
  788 |     UCHAR RemoteWakeEnabled:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:789:5: error: unknown type name 'UCHAR'
  789 |     UCHAR Reserved:6;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:806:3: error: unknown type name 'UCHAR'
  806 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:807:3: error: unknown type name 'UCHAR'
  807 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:808:3: error: unknown type name 'UCHAR'
  808 |   UCHAR SelfPowerConsumedD0[3];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:809:3: error: unknown type name 'UCHAR'
  809 |   UCHAR bPowerSummaryId;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:810:3: error: unknown type name 'UCHAR'
  810 |   UCHAR bBusPowerSavingD1;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:811:3: error: unknown type name 'UCHAR'
  811 |   UCHAR bSelfPowerSavingD1;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:812:3: error: unknown type name 'UCHAR'
  812 |   UCHAR bBusPowerSavingD2;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:813:3: error: unknown type name 'UCHAR'
  813 |   UCHAR bSelfPowerSavingD2;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:814:3: error: unknown type name 'UCHAR'
  814 |   UCHAR bBusPowerSavingD3;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:815:3: error: unknown type name 'UCHAR'
  815 |   UCHAR bSelfPowerSavingD3;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:816:3: error: unknown type name 'USHORT'
  816 |   USHORT TransitionTimeFromD1;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:817:3: error: unknown type name 'USHORT'
  817 |   USHORT TransitionTimeFromD2;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:818:3: error: unknown type name 'USHORT'
  818 |   USHORT TransitionTimeFromD3;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:822:3: error: unknown type name 'UCHAR'
  822 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:823:3: error: unknown type name 'UCHAR'
  823 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:824:3: error: unknown type name 'UCHAR'
  824 |   UCHAR bmCapabilitiesFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:825:3: error: unknown type name 'UCHAR'
  825 |   UCHAR bBusPowerSavingD1;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:826:3: error: unknown type name 'UCHAR'
  826 |   UCHAR bSelfPowerSavingD1;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:827:3: error: unknown type name 'UCHAR'
  827 |   UCHAR bBusPowerSavingD2;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:828:3: error: unknown type name 'UCHAR'
  828 |   UCHAR bSelfPowerSavingD2;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:829:3: error: unknown type name 'UCHAR'
  829 |   UCHAR bBusPowerSavingD3;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:830:3: error: unknown type name 'UCHAR'
  830 |   UCHAR bSelfPowerSavingD3;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:831:3: error: unknown type name 'USHORT'
  831 |   USHORT TransitionTimeFromD1;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:832:3: error: unknown type name 'USHORT'
  832 |   USHORT TransitionTimeFromD2;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:833:3: error: unknown type name 'USHORT'
  833 |   USHORT TransitionTimeFromD3;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:156:9: error: unknown type name 'LONG'
  156 | typedef LONG USBD_STATUS;
      |         ^~~~
C:/msys64/mingw64/include/usb.h:223:9: error: unknown type name 'PVOID'
  223 | typedef PVOID USBD_PIPE_HANDLE;
      |         ^~~~~
C:/msys64/mingw64/include/usb.h:224:9: error: unknown type name 'PVOID'
  224 | typedef PVOID USBD_CONFIGURATION_HANDLE;
      |         ^~~~~
C:/msys64/mingw64/include/usb.h:225:9: error: unknown type name 'PVOID'
  225 | typedef PVOID USBD_INTERFACE_HANDLE;
      |         ^~~~~
C:/msys64/mingw64/include/usb.h:230:3: error: unknown type name 'ULONG'
  230 |   ULONG USBDI_Version;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:231:3: error: unknown type name 'ULONG'
  231 |   ULONG Supported_USB_Version;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:244:3: error: unknown type name 'ULONG'
  244 |   ULONG OffsetNext;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:245:3: error: unknown type name 'PVOID'
  245 |   PVOID UsbdDeviceHandle;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:250:3: error: unknown type name 'USHORT'
  250 |   USHORT MaximumPacketSize;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:251:3: error: unknown type name 'UCHAR'
  251 |   UCHAR EndpointAddress;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:252:3: error: unknown type name 'UCHAR'
  252 |   UCHAR Interval;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:255:3: error: unknown type name 'ULONG'
  255 |   ULONG MaximumTransferSize;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:256:3: error: unknown type name 'ULONG'
  256 |   ULONG PipeFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:266:3: error: unknown type name 'USHORT'
  266 |   USHORT Length;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:267:3: error: unknown type name 'UCHAR'
  267 |   UCHAR InterfaceNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:268:3: error: unknown type name 'UCHAR'
  268 |   UCHAR AlternateSetting;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:269:3: error: unknown type name 'UCHAR'
  269 |   UCHAR Class;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:270:3: error: unknown type name 'UCHAR'
  270 |   UCHAR SubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:271:3: error: unknown type name 'UCHAR'
  271 |   UCHAR Protocol;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:272:3: error: unknown type name 'UCHAR'
  272 |   UCHAR Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:274:3: error: unknown type name 'ULONG'
  274 |   ULONG NumberOfPipes;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:279:3: error: unknown type name 'PVOID'
  279 |   PVOID Reserved8[8];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:283:3: error: unknown type name 'USHORT'
  283 |   USHORT Length;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:284:3: error: unknown type name 'USHORT'
  284 |   USHORT Function;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:286:3: error: unknown type name 'PVOID'
  286 |   PVOID UsbdDeviceHandle;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:287:3: error: unknown type name 'ULONG'
  287 |   ULONG UsbdFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:306:3: error: unknown type name 'ULONG'
  306 |   ULONG Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:315:3: error: unknown type name 'ULONG'
  315 |   ULONG FrameLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:316:3: error: unknown type name 'ULONG'
  316 |   ULONG FrameNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:321:3: error: unknown type name 'LONG'
  321 |   LONG FrameLengthDelta;
      |   ^~~~
C:/msys64/mingw64/include/usb.h:326:3: error: unknown type name 'ULONG'
  326 |   ULONG FrameNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:331:3: error: unknown type name 'PVOID'
  331 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:332:3: error: unknown type name 'ULONG'
  332 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:333:3: error: unknown type name 'ULONG'
  333 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:334:3: error: unknown type name 'PVOID'
  334 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:338:3: error: unknown type name 'USHORT'
  338 |   USHORT Reserved1;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:339:3: error: unknown type name 'UCHAR'
  339 |   UCHAR Index;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:340:3: error: unknown type name 'UCHAR'
  340 |   UCHAR DescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:341:3: error: unknown type name 'USHORT'
  341 |   USHORT LanguageId;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:342:3: error: unknown type name 'USHORT'
  342 |   USHORT Reserved2;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:347:3: error: unknown type name 'PVOID'
  347 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:348:3: error: unknown type name 'ULONG'
  348 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:349:3: error: unknown type name 'ULONG'
  349 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:350:3: error: unknown type name 'PVOID'
  350 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:354:3: error: unknown type name 'UCHAR'
  354 |   UCHAR Reserved1[4];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:355:3: error: unknown type name 'USHORT'
  355 |   USHORT Index;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:356:3: error: unknown type name 'USHORT'
  356 |   USHORT Reserved2;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:361:3: error: unknown type name 'PVOID'
  361 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:362:3: error: unknown type name 'ULONG'
  362 |   ULONG Reserved2;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:363:3: error: unknown type name 'ULONG'
  363 |   ULONG Reserved3;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:364:3: error: unknown type name 'PVOID'
  364 |   PVOID Reserved4;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:368:3: error: unknown type name 'USHORT'
  368 |   USHORT Reserved0;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:369:3: error: unknown type name 'USHORT'
  369 |   USHORT FeatureSelector;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:370:3: error: unknown type name 'USHORT'
  370 |   USHORT Index;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:371:3: error: unknown type name 'USHORT'
  371 |   USHORT Reserved1;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:376:3: error: unknown type name 'PVOID'
  376 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:377:3: error: unknown type name 'ULONG'
  377 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:378:3: error: unknown type name 'ULONG'
  378 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:379:3: error: unknown type name 'PVOID'
  379 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:383:3: error: unknown type name 'UCHAR'
  383 |   UCHAR RequestTypeReservedBits;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:384:3: error: unknown type name 'UCHAR'
  384 |   UCHAR Request;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:385:3: error: unknown type name 'USHORT'
  385 |   USHORT Value;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:386:3: error: unknown type name 'USHORT'
  386 |   USHORT Index;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:387:3: error: unknown type name 'USHORT'
  387 |   USHORT Reserved1;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:392:3: error: unknown type name 'PVOID'
  392 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:393:3: error: unknown type name 'ULONG'
  393 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:394:3: error: unknown type name 'ULONG'
  394 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:395:3: error: unknown type name 'PVOID'
  395 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:399:3: error: unknown type name 'UCHAR'
  399 |   UCHAR Reserved1[4];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:400:3: error: unknown type name 'USHORT'
  400 |   USHORT Interface;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:401:3: error: unknown type name 'USHORT'
  401 |   USHORT Reserved2;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:406:3: error: unknown type name 'PVOID'
  406 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:407:3: error: unknown type name 'ULONG'
  407 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:408:3: error: unknown type name 'ULONG'
  408 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:409:3: error: unknown type name 'PVOID'
  409 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:413:3: error: unknown type name 'UCHAR'
  413 |   UCHAR Reserved1[8];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:426:3: error: unknown type name 'UCHAR'
  426 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:427:3: error: unknown type name 'UCHAR'
  427 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:428:3: error: unknown type name 'WCHAR'
  428 |   WCHAR MicrosoftString[7];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:429:3: error: unknown type name 'UCHAR'
  429 |   UCHAR bVendorCode;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:431:5: error: unknown type name 'UCHAR'
  431 |     UCHAR bPad;
      |     ^~~~~
C:/msys64/mingw64/include/usb.h:432:5: error: unknown type name 'UCHAR'
  432 |     UCHAR bFlags;
      |     ^~~~~
C:/msys64/mingw64/include/usb.h:438:3: error: unknown type name 'PVOID'
  438 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:439:3: error: unknown type name 'ULONG'
  439 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:440:3: error: unknown type name 'ULONG'
  440 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:441:3: error: unknown type name 'PVOID'
  441 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:445:3: error: unknown type name 'UCHAR'
  445 |   UCHAR Recipient:5;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:446:3: error: unknown type name 'UCHAR'
  446 |   UCHAR Reserved1:3;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:447:3: error: unknown type name 'UCHAR'
  447 |   UCHAR Reserved2;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:448:3: error: unknown type name 'UCHAR'
  448 |   UCHAR InterfaceNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:449:3: error: unknown type name 'UCHAR'
  449 |   UCHAR MS_PageIndex;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:450:3: error: unknown type name 'USHORT'
  450 |   USHORT MS_FeatureDescriptorIndex;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:451:3: error: unknown type name 'USHORT'
  451 |   USHORT Reserved3;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:457:3: error: unknown type name 'ULONG'
  457 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:458:3: error: unknown type name 'ULONG'
  458 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:459:3: error: unknown type name 'PVOID'
  459 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:463:3: error: unknown type name 'UCHAR'
  463 |   UCHAR SetupPacket[8];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:470:3: error: unknown type name 'ULONG'
  470 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:471:3: error: unknown type name 'ULONG'
  471 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:472:3: error: unknown type name 'PVOID'
  472 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:474:3: error: unknown type name 'ULONG'
  474 |   ULONG Timeout;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:476:3: error: unknown type name 'ULONG'
  476 |   ULONG Pad;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:479:3: error: unknown type name 'UCHAR'
  479 |   UCHAR SetupPacket[8];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:486:3: error: unknown type name 'ULONG'
  486 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:487:3: error: unknown type name 'ULONG'
  487 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:488:3: error: unknown type name 'PVOID'
  488 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:495:3: error: unknown type name 'ULONG'
  495 |   ULONG Offset;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:496:3: error: unknown type name 'ULONG'
  496 |   ULONG Length;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:503:3: error: unknown type name 'ULONG'
  503 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:504:3: error: unknown type name 'ULONG'
  504 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:505:3: error: unknown type name 'PVOID'
  505 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:509:3: error: unknown type name 'ULONG'
  509 |   ULONG StartFrame;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:510:3: error: unknown type name 'ULONG'
  510 |   ULONG NumberOfPackets;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:511:3: error: unknown type name 'ULONG'
  511 |   ULONG ErrorCount;
      |   ^~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:52:3: error: unknown type name 'usb_dev_handle'
   52 |   usb_dev_handle *dev_handle;
      |   ^~~~~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:53:32: error: field 'dev_desc' has incomplete type
   53 |   struct usb_device_descriptor dev_desc;
      |                                ^~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:54:32: error: field 'conf_desc' has incomplete type
   54 |   struct usb_config_descriptor conf_desc;
      |                                ^~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:55:35: error: field 'intf_desc' has incomplete type
   55 |   struct usb_interface_descriptor intf_desc;
      |                                   ^~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:56:34: error: field 'endp_desc' has incomplete type
   56 |   struct usb_endpoint_descriptor endp_desc;
      |                                  ^~~~~~~~~
[93/148] Building C object src/CMakeFiles/swig_avrdude.dir/flip2.c.obj
FAILED: src/CMakeFiles/swig_avrdude.dir/flip2.c.obj
C:\msys64\mingw64\bin\cc.exe -DCONFIG_DIR="\"C:/Program Files (x86)/avrdude/etc\"" -Dswig_avrdude_EXPORTS -IC:/work/avr/avrdude_test/avrdude_jw/build_mingw64_nt-10.0-19045/src -IC:/msys64/mingw64/include/python3.11 -IC:/work/avr/avrdude_test/avrdude_jw/src -IC:/work/avr/avrdude_test/avrdude_jw/build_mingw64_nt-10.0-19045/src/.. -O2 -g -DNDEBUG -std=gnu11 -Wall -Wextra -Wno-unused-parameter -MD -MT src/CMakeFiles/swig_avrdude.dir/flip2.c.obj -MF src\CMakeFiles\swig_avrdude.dir\flip2.c.obj.d -o src/CMakeFiles/swig_avrdude.dir/flip2.c.obj -c C:/work/avr/avrdude_test/avrdude_jw/src/flip2.c
In file included from C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:28,
                 from C:/work/avr/avrdude_test/avrdude_jw/src/flip2.c:35:
C:/msys64/mingw64/include/usb.h:27:9: error: unknown type name 'PVOID'
   27 | typedef PVOID PIRP;
      |         ^~~~~
C:/msys64/mingw64/include/usb.h:28:9: error: unknown type name 'PVOID'
   28 | typedef PVOID PMDL;
      |         ^~~~~
In file included from C:/msys64/mingw64/include/usb.h:34:
C:/msys64/mingw64/include/usbspec.h:28:5: error: unknown type name 'UCHAR'
   28 |     UCHAR Recipient:2;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:29:5: error: unknown type name 'UCHAR'
   29 |     UCHAR Reserved:3;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:30:5: error: unknown type name 'UCHAR'
   30 |     UCHAR Type:2;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:31:5: error: unknown type name 'UCHAR'
   31 |     UCHAR Dir:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:33:3: error: unknown type name 'UCHAR'
   33 |   UCHAR B;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:38:3: error: unknown type name 'UCHAR'
   38 |   UCHAR bRequest;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:41:7: error: unknown type name 'UCHAR'
   41 |       UCHAR LowByte;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:42:7: error: unknown type name 'UCHAR'
   42 |       UCHAR HiByte;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:44:5: error: unknown type name 'USHORT'
   44 |     USHORT W;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:48:7: error: unknown type name 'UCHAR'
   48 |       UCHAR LowByte;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:49:7: error: unknown type name 'UCHAR'
   49 |       UCHAR HiByte;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:51:5: error: unknown type name 'USHORT'
   51 |     USHORT W;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:53:3: error: unknown type name 'USHORT'
   53 |   USHORT wLength;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:136:3: error: unknown type name 'USHORT'
  136 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:138:5: error: unknown type name 'USHORT'
  138 |     USHORT SelfPowered : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:139:5: error: unknown type name 'USHORT'
  139 |     USHORT RemoteWakeup : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:140:5: error: unknown type name 'USHORT'
  140 |     USHORT U1Enable : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:141:5: error: unknown type name 'USHORT'
  141 |     USHORT U2Enable : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:142:5: error: unknown type name 'USHORT'
  142 |     USHORT LtmEnable : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:143:5: error: unknown type name 'USHORT'
  143 |     USHORT Reserved : 11;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:148:3: error: unknown type name 'USHORT'
  148 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:150:5: error: unknown type name 'USHORT'
  150 |     USHORT RemoteWakeupCapable : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:151:5: error: unknown type name 'USHORT'
  151 |     USHORT RemoteWakeupEnabled : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:152:5: error: unknown type name 'USHORT'
  152 |     USHORT Reserved : 14;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:157:3: error: unknown type name 'USHORT'
  157 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:159:5: error: unknown type name 'USHORT'
  159 |     USHORT Halt : 1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:160:5: error: unknown type name 'USHORT'
  160 |     USHORT Reserved : 15;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:165:3: error: unknown type name 'UCHAR'
  165 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:166:3: error: unknown type name 'UCHAR'
  166 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:170:3: error: unknown type name 'UCHAR'
  170 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:171:3: error: unknown type name 'UCHAR'
  171 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:172:3: error: unknown type name 'USHORT'
  172 |   USHORT bcdUSB;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:173:3: error: unknown type name 'UCHAR'
  173 |   UCHAR bDeviceClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:174:3: error: unknown type name 'UCHAR'
  174 |   UCHAR bDeviceSubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:175:3: error: unknown type name 'UCHAR'
  175 |   UCHAR bDeviceProtocol;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:176:3: error: unknown type name 'UCHAR'
  176 |   UCHAR bMaxPacketSize0;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:177:3: error: unknown type name 'USHORT'
  177 |   USHORT idVendor;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:178:3: error: unknown type name 'USHORT'
  178 |   USHORT idProduct;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:179:3: error: unknown type name 'USHORT'
  179 |   USHORT bcdDevice;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:180:3: error: unknown type name 'UCHAR'
  180 |   UCHAR iManufacturer;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:181:3: error: unknown type name 'UCHAR'
  181 |   UCHAR iProduct;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:182:3: error: unknown type name 'UCHAR'
  182 |   UCHAR iSerialNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:183:3: error: unknown type name 'UCHAR'
  183 |   UCHAR bNumConfigurations;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:211:3: error: unknown type name 'UCHAR'
  211 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:212:3: error: unknown type name 'UCHAR'
  212 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:213:3: error: unknown type name 'USHORT'
  213 |   USHORT bcdUSB;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:214:3: error: unknown type name 'UCHAR'
  214 |   UCHAR bDeviceClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:215:3: error: unknown type name 'UCHAR'
  215 |   UCHAR bDeviceSubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:216:3: error: unknown type name 'UCHAR'
  216 |   UCHAR bDeviceProtocol;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:217:3: error: unknown type name 'UCHAR'
  217 |   UCHAR bMaxPacketSize0;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:218:3: error: unknown type name 'UCHAR'
  218 |   UCHAR bNumConfigurations;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:219:3: error: unknown type name 'UCHAR'
  219 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:223:3: error: unknown type name 'UCHAR'
  223 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:224:3: error: unknown type name 'UCHAR'
  224 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:225:3: error: unknown type name 'USHORT'
  225 |   USHORT wTotalLength;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:226:3: error: unknown type name 'UCHAR'
  226 |   UCHAR bNumDeviceCaps;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:243:3: error: unknown type name 'UCHAR'
  243 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:244:3: error: unknown type name 'UCHAR'
  244 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:245:3: error: unknown type name 'UCHAR'
  245 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:247:5: error: unknown type name 'ULONG'
  247 |     ULONG AsUlong;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:249:7: error: unknown type name 'ULONG'
  249 |       ULONG Reserved:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:250:7: error: unknown type name 'ULONG'
  250 |       ULONG LPMCapable:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:251:7: error: unknown type name 'ULONG'
  251 |       ULONG BESLAndAlternateHIRDSupported:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:252:7: error: unknown type name 'ULONG'
  252 |       ULONG BaselineBESLValid:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:253:7: error: unknown type name 'ULONG'
  253 |       ULONG DeepBESLValid:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:254:7: error: unknown type name 'ULONG'
  254 |       ULONG Reserved1:3;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:255:7: error: unknown type name 'ULONG'
  255 |       ULONG BaselineBESL:4;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:256:7: error: unknown type name 'ULONG'
  256 |       ULONG DeepBESL:4;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:257:7: error: unknown type name 'ULONG'
  257 |       ULONG Reserved2:16;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:265:3: error: unknown type name 'UCHAR'
  265 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:266:3: error: unknown type name 'UCHAR'
  266 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:267:3: error: unknown type name 'UCHAR'
  267 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:268:3: error: unknown type name 'UCHAR'
  268 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:270:5: error: unknown type name 'ULONG'
  270 |     ULONG AsUlong;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:272:7: error: unknown type name 'ULONG'
  272 |       ULONG Reserved1:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:273:7: error: unknown type name 'ULONG'
  273 |       ULONG BatteryCharging:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:274:7: error: unknown type name 'ULONG'
  274 |       ULONG USBPowerDelivery:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:275:7: error: unknown type name 'ULONG'
  275 |       ULONG Provider:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:276:7: error: unknown type name 'ULONG'
  276 |       ULONG Consumer:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:277:7: error: unknown type name 'ULONG'
  277 |       ULONG ChargingPolicy:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:278:7: error: unknown type name 'ULONG'
  278 |       ULONG TypeCCurrent:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:279:7: error: unknown type name 'ULONG'
  279 |       ULONG Reserved2:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:280:7: error: unknown type name 'ULONG'
  280 |       ULONG ACSupply:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:281:7: error: unknown type name 'ULONG'
  281 |       ULONG Battery:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:282:7: error: unknown type name 'ULONG'
  282 |       ULONG Other:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:283:7: error: unknown type name 'ULONG'
  283 |       ULONG NumBatteries:3;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:284:7: error: unknown type name 'ULONG'
  284 |       ULONG UsesVbus:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:285:7: error: unknown type name 'ULONG'
  285 |       ULONG Reserved3:17;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:288:3: error: unknown type name 'USHORT'
  288 |   USHORT bmProviderPorts;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:289:3: error: unknown type name 'USHORT'
  289 |   USHORT bmConsumerPorts;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:290:3: error: unknown type name 'USHORT'
  290 |   USHORT bcdBCVersion;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:291:3: error: unknown type name 'USHORT'
  291 |   USHORT bcdPDVersion;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:292:3: error: unknown type name 'USHORT'
  292 |   USHORT bcdUSBTypeCVersion;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:296:3: error: unknown type name 'UCHAR'
  296 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:297:3: error: unknown type name 'UCHAR'
  297 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:298:3: error: unknown type name 'UCHAR'
  298 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:299:3: error: unknown type name 'UCHAR'
  299 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:301:5: error: unknown type name 'USHORT'
  301 |     USHORT AsUshort;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:303:9: error: unknown type name 'USHORT'
  303 |         USHORT BatteryCharging:1;
      |         ^~~~~~
C:/msys64/mingw64/include/usbspec.h:304:9: error: unknown type name 'USHORT'
  304 |         USHORT USBPowerDelivery:1;
      |         ^~~~~~
C:/msys64/mingw64/include/usbspec.h:305:9: error: unknown type name 'USHORT'
  305 |         USHORT USBTypeCCurrent:1;
      |         ^~~~~~
C:/msys64/mingw64/include/usbspec.h:306:9: error: unknown type name 'USHORT'
  306 |         USHORT Reserved:13;
      |         ^~~~~~
C:/msys64/mingw64/include/usbspec.h:309:3: error: unknown type name 'USHORT'
  309 |   USHORT wMinVoltage;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:310:3: error: unknown type name 'USHORT'
  310 |   USHORT wMaxVoltage;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:311:3: error: unknown type name 'USHORT'
  311 |   USHORT wReserved;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:312:3: error: unknown type name 'ULONG'
  312 |   ULONG dwMaxOperatingPower;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:313:3: error: unknown type name 'ULONG'
  313 |   ULONG dwMaxPeakPower;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:314:3: error: unknown type name 'ULONG'
  314 |   ULONG dwMaxPeakPowerTime;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:318:3: error: unknown type name 'UCHAR'
  318 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:319:3: error: unknown type name 'UCHAR'
  319 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:320:3: error: unknown type name 'UCHAR'
  320 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:321:3: error: unknown type name 'UCHAR'
  321 |   UCHAR bmAttributes;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:322:3: error: unknown type name 'USHORT'
  322 |   USHORT wSpeedsSupported;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:323:3: error: unknown type name 'UCHAR'
  323 |   UCHAR bFunctionalitySupport;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:324:3: error: unknown type name 'UCHAR'
  324 |   UCHAR bU1DevExitLat;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:325:3: error: unknown type name 'USHORT'
  325 |   USHORT wU2DevExitLat;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:363:3: error: unknown type name 'ULONG'
  363 |   ULONG AsUlong32;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:365:5: error: unknown type name 'ULONG'
  365 |     ULONG SublinkSpeedAttrID:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:366:5: error: unknown type name 'ULONG'
  366 |     ULONG LaneSpeedExponent:2;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:367:5: error: unknown type name 'ULONG'
  367 |     ULONG SublinkTypeMode:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:368:5: error: unknown type name 'ULONG'
  368 |     ULONG SublinkTypeDir:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:369:5: error: unknown type name 'ULONG'
  369 |     ULONG Reserved:6;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:370:5: error: unknown type name 'ULONG'
  370 |     ULONG LinkProtocol:2;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:371:5: error: unknown type name 'ULONG'
  371 |     ULONG LaneSpeedMantissa:16;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:376:3: error: unknown type name 'UCHAR'
  376 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:377:3: error: unknown type name 'UCHAR'
  377 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:378:3: error: unknown type name 'UCHAR'
  378 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:379:3: error: unknown type name 'UCHAR'
  379 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:381:5: error: unknown type name 'ULONG'
  381 |     ULONG AsUlong;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:383:7: error: unknown type name 'ULONG'
  383 |       ULONG SublinkSpeedAttrCount:5;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:384:7: error: unknown type name 'ULONG'
  384 |       ULONG SublinkSpeedIDCount:4;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:385:7: error: unknown type name 'ULONG'
  385 |       ULONG Reserved:23;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:389:5: error: unknown type name 'USHORT'
  389 |     USHORT AsUshort;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:391:7: error: unknown type name 'USHORT'
  391 |       USHORT SublinkSpeedAttrID:4;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:392:7: error: unknown type name 'USHORT'
  392 |       USHORT Reserved:4;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:393:7: error: unknown type name 'USHORT'
  393 |       USHORT MinRxLaneCount:4;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:394:7: error: unknown type name 'USHORT'
  394 |       USHORT MinTxLaneCount:4;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:397:3: error: unknown type name 'USHORT'
  397 |   USHORT wReserved;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:402:3: error: unknown type name 'UCHAR'
  402 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:403:3: error: unknown type name 'UCHAR'
  403 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:404:3: error: unknown type name 'UCHAR'
  404 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:405:3: error: unknown type name 'UCHAR'
  405 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:406:3: error: unknown type name 'UCHAR'
  406 |   UCHAR ContainerID[16];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:410:3: error: unknown type name 'UCHAR'
  410 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:411:3: error: unknown type name 'UCHAR'
  411 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:412:3: error: unknown type name 'UCHAR'
  412 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:413:3: error: unknown type name 'UCHAR'
  413 |   UCHAR bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:414:3: error: unknown type name 'GUID'
  414 |   GUID PlatformCapabilityUuid;
      |   ^~~~
C:/msys64/mingw64/include/usbspec.h:415:3: error: unknown type name 'UCHAR'
  415 |   UCHAR CapabililityData[1];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:419:3: error: unknown type name 'UCHAR'
  419 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:420:3: error: unknown type name 'UCHAR'
  420 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:421:3: error: unknown type name 'UCHAR'
  421 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:422:3: error: unknown type name 'UCHAR'
  422 |   UCHAR iAddtionalInfoURL;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:423:3: error: unknown type name 'UCHAR'
  423 |   UCHAR bNumberOfAlternateModes;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:424:3: error: unknown type name 'UCHAR'
  424 |   UCHAR bPreferredAlternateMode;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:426:5: error: unknown type name 'USHORT'
  426 |     USHORT AsUshort;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:428:7: error: unknown type name 'USHORT'
  428 |       USHORT VConnPowerNeededForFullFunctionality:3;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:429:7: error: unknown type name 'USHORT'
  429 |       USHORT Reserved:12;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:430:7: error: unknown type name 'USHORT'
  430 |       USHORT NoVconnPowerRequired:1;
      |       ^~~~~~
C:/msys64/mingw64/include/usbspec.h:433:3: error: unknown type name 'UCHAR'
  433 |   UCHAR bmConfigured[32];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:434:3: error: unknown type name 'ULONG'
  434 |   ULONG bReserved;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:436:5: error: unknown type name 'USHORT'
  436 |     USHORT wSVID;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:437:5: error: unknown type name 'UCHAR'
  437 |     UCHAR bAlternateMode;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:438:5: error: unknown type name 'UCHAR'
  438 |     UCHAR iAlternateModeSetting;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:442:52: error: expected ')' before numeric constant
  442 | DEFINE_GUID(GUID_USB_MSOS20_PLATFORM_CAPABILITY_ID, 0xD8DD60DF, 0x4589, 0x4CC7, 0x9C, 0xD2, 0x65, 0x9D, 0x9E, 0x64, 0x8A, 0x9F);
      |                                                    ^~~~~~~~~~~
      |                                                    )
C:/msys64/mingw64/include/usbspec.h:445:3: error: unknown type name 'UCHAR'
  445 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:446:3: error: unknown type name 'UCHAR'
  446 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:447:3: error: unknown type name 'UCHAR'
  447 |   UCHAR bDevCapabilityType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:451:3: error: unknown type name 'UCHAR'
  451 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:452:3: error: unknown type name 'UCHAR'
  452 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:453:3: error: unknown type name 'USHORT'
  453 |   USHORT wTotalLength;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:454:3: error: unknown type name 'UCHAR'
  454 |   UCHAR bNumInterfaces;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:455:3: error: unknown type name 'UCHAR'
  455 |   UCHAR bConfigurationValue;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:456:3: error: unknown type name 'UCHAR'
  456 |   UCHAR iConfiguration;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:457:3: error: unknown type name 'UCHAR'
  457 |   UCHAR bmAttributes;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:458:3: error: unknown type name 'UCHAR'
  458 |   UCHAR MaxPower;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:468:3: error: unknown type name 'UCHAR'
  468 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:469:3: error: unknown type name 'UCHAR'
  469 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:470:3: error: unknown type name 'UCHAR'
  470 |   UCHAR bFirstInterface;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:471:3: error: unknown type name 'UCHAR'
  471 |   UCHAR bInterfaceCount;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:472:3: error: unknown type name 'UCHAR'
  472 |   UCHAR bFunctionClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:473:3: error: unknown type name 'UCHAR'
  473 |   UCHAR bFunctionSubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:474:3: error: unknown type name 'UCHAR'
  474 |   UCHAR bFunctionProtocol;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:475:3: error: unknown type name 'UCHAR'
  475 |   UCHAR iFunction;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:479:3: error: unknown type name 'UCHAR'
  479 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:480:3: error: unknown type name 'UCHAR'
  480 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:481:3: error: unknown type name 'UCHAR'
  481 |   UCHAR bInterfaceNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:482:3: error: unknown type name 'UCHAR'
  482 |   UCHAR bAlternateSetting;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:483:3: error: unknown type name 'UCHAR'
  483 |   UCHAR bNumEndpoints;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:484:3: error: unknown type name 'UCHAR'
  484 |   UCHAR bInterfaceClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:485:3: error: unknown type name 'UCHAR'
  485 |   UCHAR bInterfaceSubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:486:3: error: unknown type name 'UCHAR'
  486 |   UCHAR bInterfaceProtocol;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:487:3: error: unknown type name 'UCHAR'
  487 |   UCHAR iInterface;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:491:3: error: unknown type name 'UCHAR'
  491 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:492:3: error: unknown type name 'UCHAR'
  492 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:493:3: error: unknown type name 'UCHAR'
  493 |   UCHAR bEndpointAddress;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:494:3: error: unknown type name 'UCHAR'
  494 |   UCHAR bmAttributes;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:495:3: error: unknown type name 'USHORT'
  495 |   USHORT wMaxPacketSize;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:496:3: error: unknown type name 'UCHAR'
  496 |   UCHAR bInterval;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:540:5: error: unknown type name 'USHORT'
  540 |     USHORT MaxPacket : 11;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:541:5: error: unknown type name 'USHORT'
  541 |     USHORT HSmux : 2;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:542:5: error: unknown type name 'USHORT'
  542 |     USHORT Reserved : 3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:544:3: error: unknown type name 'USHORT'
  544 |   USHORT us;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:553:3: error: unknown type name 'UCHAR'
  553 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:554:3: error: unknown type name 'UCHAR'
  554 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:555:3: error: unknown type name 'WCHAR'
  555 |   WCHAR bString[1];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:561:3: error: unknown type name 'UCHAR'
  561 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:562:3: error: unknown type name 'UCHAR'
  562 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:563:3: error: unknown type name 'UCHAR'
  563 |   UCHAR bMaxBurst;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:565:5: error: unknown type name 'UCHAR'
  565 |     UCHAR AsUchar;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:567:7: error: unknown type name 'UCHAR'
  567 |       UCHAR MaxStreams:5;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:568:7: error: unknown type name 'UCHAR'
  568 |       UCHAR Reserved1:3;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:571:7: error: unknown type name 'UCHAR'
  571 |       UCHAR Mult:2;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:572:7: error: unknown type name 'UCHAR'
  572 |       UCHAR Reserved2:5;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:573:7: error: unknown type name 'UCHAR'
  573 |       UCHAR SspCompanion:1;
      |       ^~~~~
C:/msys64/mingw64/include/usbspec.h:576:3: error: unknown type name 'USHORT'
  576 |   USHORT wBytesPerInterval;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:582:3: error: unknown type name 'UCHAR'
  582 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:583:3: error: unknown type name 'UCHAR'
  583 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:584:3: error: unknown type name 'USHORT'
  584 |   USHORT wReserved;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:585:3: error: unknown type name 'ULONG'
  585 |   ULONG dwBytesPerInterval;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:592:3: error: unknown type name 'UCHAR'
  592 |   UCHAR bDescriptorLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:593:3: error: unknown type name 'UCHAR'
  593 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:594:3: error: unknown type name 'UCHAR'
  594 |   UCHAR bNumberOfPorts;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:595:3: error: unknown type name 'USHORT'
  595 |   USHORT wHubCharacteristics;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:596:3: error: unknown type name 'UCHAR'
  596 |   UCHAR bPowerOnToPowerGood;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:597:3: error: unknown type name 'UCHAR'
  597 |   UCHAR bHubControlCurrent;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:598:3: error: unknown type name 'UCHAR'
  598 |   UCHAR bRemoveAndPowerMask[64];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:604:3: error: unknown type name 'UCHAR'
  604 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:605:3: error: unknown type name 'UCHAR'
  605 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:606:3: error: unknown type name 'UCHAR'
  606 |   UCHAR bNumberOfPorts;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:607:3: error: unknown type name 'USHORT'
  607 |   USHORT wHubCharacteristics;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:608:3: error: unknown type name 'UCHAR'
  608 |   UCHAR bPowerOnToPowerGood;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:609:3: error: unknown type name 'UCHAR'
  609 |   UCHAR bHubControlCurrent;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:610:3: error: unknown type name 'UCHAR'
  610 |   UCHAR bHubHdrDecLat;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:611:3: error: unknown type name 'USHORT'
  611 |   USHORT wHubDelay;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:612:3: error: unknown type name 'USHORT'
  612 |   USHORT DeviceRemovable;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:628:3: error: unknown type name 'USHORT'
  628 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:630:5: error: unknown type name 'USHORT'
  630 |     USHORT LocalPowerLost:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:631:5: error: unknown type name 'USHORT'
  631 |     USHORT OverCurrent:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:632:5: error: unknown type name 'USHORT'
  632 |     USHORT Reserved:14;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:637:3: error: unknown type name 'USHORT'
  637 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:639:5: error: unknown type name 'USHORT'
  639 |     USHORT LocalPowerChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:640:5: error: unknown type name 'USHORT'
  640 |     USHORT OverCurrentChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:641:5: error: unknown type name 'USHORT'
  641 |     USHORT Reserved:14;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:646:3: error: unknown type name 'ULONG'
  646 |   ULONG AsUlong32;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:654:3: error: unknown type name 'USHORT'
  654 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:656:5: error: unknown type name 'USHORT'
  656 |     USHORT CurrentConnectStatus:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:657:5: error: unknown type name 'USHORT'
  657 |     USHORT PortEnabledDisabled:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:658:5: error: unknown type name 'USHORT'
  658 |     USHORT Suspend:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:659:5: error: unknown type name 'USHORT'
  659 |     USHORT OverCurrent:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:660:5: error: unknown type name 'USHORT'
  660 |     USHORT Reset:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:661:5: error: unknown type name 'USHORT'
  661 |     USHORT Reserved0:3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:662:5: error: unknown type name 'USHORT'
  662 |     USHORT PortPower:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:663:5: error: unknown type name 'USHORT'
  663 |     USHORT LowSpeedDeviceAttached:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:664:5: error: unknown type name 'USHORT'
  664 |     USHORT HighSpeedDeviceAttached:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:665:5: error: unknown type name 'USHORT'
  665 |     USHORT PortTestMode:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:666:5: error: unknown type name 'USHORT'
  666 |     USHORT PortIndicatorControl:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:667:5: error: unknown type name 'USHORT'
  667 |     USHORT Reserved1:3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:681:3: error: unknown type name 'USHORT'
  681 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:683:5: error: unknown type name 'USHORT'
  683 |     USHORT ConnectStatusChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:684:5: error: unknown type name 'USHORT'
  684 |     USHORT PortEnableDisableChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:685:5: error: unknown type name 'USHORT'
  685 |     USHORT SuspendChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:686:5: error: unknown type name 'USHORT'
  686 |     USHORT OverCurrentIndicatorChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:687:5: error: unknown type name 'USHORT'
  687 |     USHORT ResetChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:688:5: error: unknown type name 'USHORT'
  688 |     USHORT Reserved2:11;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:693:3: error: unknown type name 'USHORT'
  693 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:695:5: error: unknown type name 'USHORT'
  695 |     USHORT CurrentConnectStatus:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:696:5: error: unknown type name 'USHORT'
  696 |     USHORT PortEnabledDisabled:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:697:5: error: unknown type name 'USHORT'
  697 |     USHORT Reserved0:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:698:5: error: unknown type name 'USHORT'
  698 |     USHORT OverCurrent:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:699:5: error: unknown type name 'USHORT'
  699 |     USHORT Reset:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:700:5: error: unknown type name 'USHORT'
  700 |     USHORT PortLinkState:4;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:701:5: error: unknown type name 'USHORT'
  701 |     USHORT PortPower:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:702:5: error: unknown type name 'USHORT'
  702 |     USHORT NegotiatedDeviceSpeed:3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:703:5: error: unknown type name 'USHORT'
  703 |     USHORT Reserved1:3;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:722:3: error: unknown type name 'USHORT'
  722 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:724:5: error: unknown type name 'USHORT'
  724 |     USHORT ConnectStatusChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:725:5: error: unknown type name 'USHORT'
  725 |     USHORT Reserved2:2;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:726:5: error: unknown type name 'USHORT'
  726 |     USHORT OverCurrentIndicatorChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:727:5: error: unknown type name 'USHORT'
  727 |     USHORT ResetChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:728:5: error: unknown type name 'USHORT'
  728 |     USHORT BHResetChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:729:5: error: unknown type name 'USHORT'
  729 |     USHORT PortLinkStateChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:730:5: error: unknown type name 'USHORT'
  730 |     USHORT PortConfigErrorChange:1;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:731:5: error: unknown type name 'USHORT'
  731 |     USHORT Reserved3:8;
      |     ^~~~~~
C:/msys64/mingw64/include/usbspec.h:736:3: error: unknown type name 'USHORT'
  736 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:742:3: error: unknown type name 'USHORT'
  742 |   USHORT AsUshort16;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:748:3: error: unknown type name 'ULONG'
  748 |   ULONG AsUlong32;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:750:5: error: unknown type name 'ULONG'
  750 |     ULONG RxSublinkSpeedID:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:751:5: error: unknown type name 'ULONG'
  751 |     ULONG TxSublinkSpeedID:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:752:5: error: unknown type name 'ULONG'
  752 |     ULONG RxLaneCount:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:753:5: error: unknown type name 'ULONG'
  753 |     ULONG TxLaneCount:4;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:754:5: error: unknown type name 'ULONG'
  754 |     ULONG Reserved:16;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:759:3: error: unknown type name 'ULONG'
  759 |   ULONG AsUlong32;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:767:3: error: unknown type name 'ULONG64'
  767 |   ULONG64 AsUlong64;
      |   ^~~~~~~
C:/msys64/mingw64/include/usbspec.h:775:3: error: unknown type name 'UCHAR'
  775 |   UCHAR AsUchar8;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:777:5: error: unknown type name 'UCHAR'
  777 |     UCHAR ConnectRemoteWakeEnable:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:778:5: error: unknown type name 'UCHAR'
  778 |     UCHAR DisconnectRemoteWakeEnable:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:779:5: error: unknown type name 'UCHAR'
  779 |     UCHAR OverCurrentRemoteWakeEnable:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:780:5: error: unknown type name 'UCHAR'
  780 |     UCHAR Reserved0:5;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:785:3: error: unknown type name 'UCHAR'
  785 |   UCHAR AsUchar;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:787:5: error: unknown type name 'UCHAR'
  787 |     UCHAR PowerState:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:788:5: error: unknown type name 'UCHAR'
  788 |     UCHAR RemoteWakeEnabled:1;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:789:5: error: unknown type name 'UCHAR'
  789 |     UCHAR Reserved:6;
      |     ^~~~~
C:/msys64/mingw64/include/usbspec.h:806:3: error: unknown type name 'UCHAR'
  806 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:807:3: error: unknown type name 'UCHAR'
  807 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:808:3: error: unknown type name 'UCHAR'
  808 |   UCHAR SelfPowerConsumedD0[3];
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:809:3: error: unknown type name 'UCHAR'
  809 |   UCHAR bPowerSummaryId;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:810:3: error: unknown type name 'UCHAR'
  810 |   UCHAR bBusPowerSavingD1;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:811:3: error: unknown type name 'UCHAR'
  811 |   UCHAR bSelfPowerSavingD1;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:812:3: error: unknown type name 'UCHAR'
  812 |   UCHAR bBusPowerSavingD2;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:813:3: error: unknown type name 'UCHAR'
  813 |   UCHAR bSelfPowerSavingD2;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:814:3: error: unknown type name 'UCHAR'
  814 |   UCHAR bBusPowerSavingD3;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:815:3: error: unknown type name 'UCHAR'
  815 |   UCHAR bSelfPowerSavingD3;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:816:3: error: unknown type name 'USHORT'
  816 |   USHORT TransitionTimeFromD1;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:817:3: error: unknown type name 'USHORT'
  817 |   USHORT TransitionTimeFromD2;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:818:3: error: unknown type name 'USHORT'
  818 |   USHORT TransitionTimeFromD3;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:822:3: error: unknown type name 'UCHAR'
  822 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:823:3: error: unknown type name 'UCHAR'
  823 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:824:3: error: unknown type name 'UCHAR'
  824 |   UCHAR bmCapabilitiesFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:825:3: error: unknown type name 'UCHAR'
  825 |   UCHAR bBusPowerSavingD1;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:826:3: error: unknown type name 'UCHAR'
  826 |   UCHAR bSelfPowerSavingD1;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:827:3: error: unknown type name 'UCHAR'
  827 |   UCHAR bBusPowerSavingD2;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:828:3: error: unknown type name 'UCHAR'
  828 |   UCHAR bSelfPowerSavingD2;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:829:3: error: unknown type name 'UCHAR'
  829 |   UCHAR bBusPowerSavingD3;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:830:3: error: unknown type name 'UCHAR'
  830 |   UCHAR bSelfPowerSavingD3;
      |   ^~~~~
C:/msys64/mingw64/include/usbspec.h:831:3: error: unknown type name 'USHORT'
  831 |   USHORT TransitionTimeFromD1;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:832:3: error: unknown type name 'USHORT'
  832 |   USHORT TransitionTimeFromD2;
      |   ^~~~~~
C:/msys64/mingw64/include/usbspec.h:833:3: error: unknown type name 'USHORT'
  833 |   USHORT TransitionTimeFromD3;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:156:9: error: unknown type name 'LONG'
  156 | typedef LONG USBD_STATUS;
      |         ^~~~
C:/msys64/mingw64/include/usb.h:223:9: error: unknown type name 'PVOID'
  223 | typedef PVOID USBD_PIPE_HANDLE;
      |         ^~~~~
C:/msys64/mingw64/include/usb.h:224:9: error: unknown type name 'PVOID'
  224 | typedef PVOID USBD_CONFIGURATION_HANDLE;
      |         ^~~~~
C:/msys64/mingw64/include/usb.h:225:9: error: unknown type name 'PVOID'
  225 | typedef PVOID USBD_INTERFACE_HANDLE;
      |         ^~~~~
C:/msys64/mingw64/include/usb.h:230:3: error: unknown type name 'ULONG'
  230 |   ULONG USBDI_Version;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:231:3: error: unknown type name 'ULONG'
  231 |   ULONG Supported_USB_Version;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:244:3: error: unknown type name 'ULONG'
  244 |   ULONG OffsetNext;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:245:3: error: unknown type name 'PVOID'
  245 |   PVOID UsbdDeviceHandle;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:250:3: error: unknown type name 'USHORT'
  250 |   USHORT MaximumPacketSize;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:251:3: error: unknown type name 'UCHAR'
  251 |   UCHAR EndpointAddress;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:252:3: error: unknown type name 'UCHAR'
  252 |   UCHAR Interval;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:255:3: error: unknown type name 'ULONG'
  255 |   ULONG MaximumTransferSize;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:256:3: error: unknown type name 'ULONG'
  256 |   ULONG PipeFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:266:3: error: unknown type name 'USHORT'
  266 |   USHORT Length;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:267:3: error: unknown type name 'UCHAR'
  267 |   UCHAR InterfaceNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:268:3: error: unknown type name 'UCHAR'
  268 |   UCHAR AlternateSetting;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:269:3: error: unknown type name 'UCHAR'
  269 |   UCHAR Class;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:270:3: error: unknown type name 'UCHAR'
  270 |   UCHAR SubClass;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:271:3: error: unknown type name 'UCHAR'
  271 |   UCHAR Protocol;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:272:3: error: unknown type name 'UCHAR'
  272 |   UCHAR Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:274:3: error: unknown type name 'ULONG'
  274 |   ULONG NumberOfPipes;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:279:3: error: unknown type name 'PVOID'
  279 |   PVOID Reserved8[8];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:283:3: error: unknown type name 'USHORT'
  283 |   USHORT Length;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:284:3: error: unknown type name 'USHORT'
  284 |   USHORT Function;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:286:3: error: unknown type name 'PVOID'
  286 |   PVOID UsbdDeviceHandle;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:287:3: error: unknown type name 'ULONG'
  287 |   ULONG UsbdFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:306:3: error: unknown type name 'ULONG'
  306 |   ULONG Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:315:3: error: unknown type name 'ULONG'
  315 |   ULONG FrameLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:316:3: error: unknown type name 'ULONG'
  316 |   ULONG FrameNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:321:3: error: unknown type name 'LONG'
  321 |   LONG FrameLengthDelta;
      |   ^~~~
C:/msys64/mingw64/include/usb.h:326:3: error: unknown type name 'ULONG'
  326 |   ULONG FrameNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:331:3: error: unknown type name 'PVOID'
  331 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:332:3: error: unknown type name 'ULONG'
  332 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:333:3: error: unknown type name 'ULONG'
  333 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:334:3: error: unknown type name 'PVOID'
  334 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:338:3: error: unknown type name 'USHORT'
  338 |   USHORT Reserved1;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:339:3: error: unknown type name 'UCHAR'
  339 |   UCHAR Index;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:340:3: error: unknown type name 'UCHAR'
  340 |   UCHAR DescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:341:3: error: unknown type name 'USHORT'
  341 |   USHORT LanguageId;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:342:3: error: unknown type name 'USHORT'
  342 |   USHORT Reserved2;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:347:3: error: unknown type name 'PVOID'
  347 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:348:3: error: unknown type name 'ULONG'
  348 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:349:3: error: unknown type name 'ULONG'
  349 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:350:3: error: unknown type name 'PVOID'
  350 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:354:3: error: unknown type name 'UCHAR'
  354 |   UCHAR Reserved1[4];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:355:3: error: unknown type name 'USHORT'
  355 |   USHORT Index;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:356:3: error: unknown type name 'USHORT'
  356 |   USHORT Reserved2;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:361:3: error: unknown type name 'PVOID'
  361 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:362:3: error: unknown type name 'ULONG'
  362 |   ULONG Reserved2;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:363:3: error: unknown type name 'ULONG'
  363 |   ULONG Reserved3;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:364:3: error: unknown type name 'PVOID'
  364 |   PVOID Reserved4;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:368:3: error: unknown type name 'USHORT'
  368 |   USHORT Reserved0;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:369:3: error: unknown type name 'USHORT'
  369 |   USHORT FeatureSelector;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:370:3: error: unknown type name 'USHORT'
  370 |   USHORT Index;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:371:3: error: unknown type name 'USHORT'
  371 |   USHORT Reserved1;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:376:3: error: unknown type name 'PVOID'
  376 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:377:3: error: unknown type name 'ULONG'
  377 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:378:3: error: unknown type name 'ULONG'
  378 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:379:3: error: unknown type name 'PVOID'
  379 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:383:3: error: unknown type name 'UCHAR'
  383 |   UCHAR RequestTypeReservedBits;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:384:3: error: unknown type name 'UCHAR'
  384 |   UCHAR Request;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:385:3: error: unknown type name 'USHORT'
  385 |   USHORT Value;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:386:3: error: unknown type name 'USHORT'
  386 |   USHORT Index;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:387:3: error: unknown type name 'USHORT'
  387 |   USHORT Reserved1;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:392:3: error: unknown type name 'PVOID'
  392 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:393:3: error: unknown type name 'ULONG'
  393 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:394:3: error: unknown type name 'ULONG'
  394 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:395:3: error: unknown type name 'PVOID'
  395 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:399:3: error: unknown type name 'UCHAR'
  399 |   UCHAR Reserved1[4];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:400:3: error: unknown type name 'USHORT'
  400 |   USHORT Interface;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:401:3: error: unknown type name 'USHORT'
  401 |   USHORT Reserved2;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:406:3: error: unknown type name 'PVOID'
  406 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:407:3: error: unknown type name 'ULONG'
  407 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:408:3: error: unknown type name 'ULONG'
  408 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:409:3: error: unknown type name 'PVOID'
  409 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:413:3: error: unknown type name 'UCHAR'
  413 |   UCHAR Reserved1[8];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:426:3: error: unknown type name 'UCHAR'
  426 |   UCHAR bLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:427:3: error: unknown type name 'UCHAR'
  427 |   UCHAR bDescriptorType;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:428:3: error: unknown type name 'WCHAR'
  428 |   WCHAR MicrosoftString[7];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:429:3: error: unknown type name 'UCHAR'
  429 |   UCHAR bVendorCode;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:431:5: error: unknown type name 'UCHAR'
  431 |     UCHAR bPad;
      |     ^~~~~
C:/msys64/mingw64/include/usb.h:432:5: error: unknown type name 'UCHAR'
  432 |     UCHAR bFlags;
      |     ^~~~~
C:/msys64/mingw64/include/usb.h:438:3: error: unknown type name 'PVOID'
  438 |   PVOID Reserved;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:439:3: error: unknown type name 'ULONG'
  439 |   ULONG Reserved0;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:440:3: error: unknown type name 'ULONG'
  440 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:441:3: error: unknown type name 'PVOID'
  441 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:445:3: error: unknown type name 'UCHAR'
  445 |   UCHAR Recipient:5;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:446:3: error: unknown type name 'UCHAR'
  446 |   UCHAR Reserved1:3;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:447:3: error: unknown type name 'UCHAR'
  447 |   UCHAR Reserved2;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:448:3: error: unknown type name 'UCHAR'
  448 |   UCHAR InterfaceNumber;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:449:3: error: unknown type name 'UCHAR'
  449 |   UCHAR MS_PageIndex;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:450:3: error: unknown type name 'USHORT'
  450 |   USHORT MS_FeatureDescriptorIndex;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:451:3: error: unknown type name 'USHORT'
  451 |   USHORT Reserved3;
      |   ^~~~~~
C:/msys64/mingw64/include/usb.h:457:3: error: unknown type name 'ULONG'
  457 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:458:3: error: unknown type name 'ULONG'
  458 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:459:3: error: unknown type name 'PVOID'
  459 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:463:3: error: unknown type name 'UCHAR'
  463 |   UCHAR SetupPacket[8];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:470:3: error: unknown type name 'ULONG'
  470 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:471:3: error: unknown type name 'ULONG'
  471 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:472:3: error: unknown type name 'PVOID'
  472 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:474:3: error: unknown type name 'ULONG'
  474 |   ULONG Timeout;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:476:3: error: unknown type name 'ULONG'
  476 |   ULONG Pad;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:479:3: error: unknown type name 'UCHAR'
  479 |   UCHAR SetupPacket[8];
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:486:3: error: unknown type name 'ULONG'
  486 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:487:3: error: unknown type name 'ULONG'
  487 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:488:3: error: unknown type name 'PVOID'
  488 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:495:3: error: unknown type name 'ULONG'
  495 |   ULONG Offset;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:496:3: error: unknown type name 'ULONG'
  496 |   ULONG Length;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:503:3: error: unknown type name 'ULONG'
  503 |   ULONG TransferFlags;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:504:3: error: unknown type name 'ULONG'
  504 |   ULONG TransferBufferLength;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:505:3: error: unknown type name 'PVOID'
  505 |   PVOID TransferBuffer;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:509:3: error: unknown type name 'ULONG'
  509 |   ULONG StartFrame;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:510:3: error: unknown type name 'ULONG'
  510 |   ULONG NumberOfPackets;
      |   ^~~~~
C:/msys64/mingw64/include/usb.h:511:3: error: unknown type name 'ULONG'
  511 |   ULONG ErrorCount;
      |   ^~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:52:3: error: unknown type name 'usb_dev_handle'
   52 |   usb_dev_handle *dev_handle;
      |   ^~~~~~~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:53:32: error: field 'dev_desc' has incomplete type
   53 |   struct usb_device_descriptor dev_desc;
      |                                ^~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:54:32: error: field 'conf_desc' has incomplete type
   54 |   struct usb_config_descriptor conf_desc;
      |                                ^~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:55:35: error: field 'intf_desc' has incomplete type
   55 |   struct usb_interface_descriptor intf_desc;
      |                                   ^~~~~~~~~
C:/work/avr/avrdude_test/avrdude_jw/src/dfu.h:56:34: error: field 'endp_desc' has incomplete type
   56 |   struct usb_endpoint_descriptor endp_desc;
      |                                  ^~~~~~~~~
[98/148] Building C object src/CMakeFiles/swig_avrdude.dir/fileio.c.obj
ninja: build stopped: subcommand failed.
Build failed.

@dl8dtl
Copy link
Contributor Author

dl8dtl commented Mar 6, 2024

Thanks for testing. Kinda interesting, as my compile command is supposed to be the same as for standard avrdude itself …

@mcuee
Copy link
Collaborator

mcuee commented Mar 6, 2024

Thanks for testing. Kinda interesting, as my compile command is supposed to be the same as for standard avrdude itself …

I will test under Linux and macOS as well.

BTW, I was kind of the de-facto libftdi Windows binary packager last time. I always find it a bit troublesome to build the Python binding under Windows. So I myself actually use pyftdi (libusb/pyusb based) and pylibftdi (libftdi based).
https://sourceforge.net/projects/picusb/files/
https://learn.adafruit.com/adafruit-ft232h-breakout/windows-setup
https://pylibftdi.readthedocs.io/en/latest/installation.html

@dl8dtl
Copy link
Contributor Author

dl8dtl commented Mar 6, 2024

I will test under Linux and macOS as well.

The CI runs already fail at MacOS, with what seems not finding the Python libraries. I guess it's merely something needed inside the CMake stuff for that.

Linux and FreeBSD builds work fine, both in CI as well as physically for me.

The more interesting part in your failure is that it's IMHO completely unrelated to SWIG or Python, as it happens in Code that is being compiled just like in the ordinary libavrdude/avrdude counterpart.

@mcuee
Copy link
Collaborator

mcuee commented Mar 6, 2024

@dl8dtl

I tried to push a quick fix for the macOS CI failure but it does not work -- it still uses the system installed Python and not Homebrew Python.

@mcuee
Copy link
Collaborator

mcuee commented Mar 6, 2024

@dl8dtl

I also pushed a commit to add the build test for MSYS2 mingw build and now should be able to see the errors under MSYS2 mingw builds from github action.

@mcuee
Copy link
Collaborator

mcuee commented Mar 6, 2024

No issues under Ubuntu 20.04 Linux.

mcuee@UbuntuSwift3 ~/build/avr/avrdude_jw (swig_libavrdude)$ python3 -i ./src/swigtest.py 
Found avrdude.conf in build_linux/src
>>> a=search_avrpart('m328')
>>> print(a)
{'desc': 'ATmega328', 'id': 'm328', 'signature': b'\x1e\x95\x14', 'mem': <Swig Object of type 'struct avrmem *' at 0x7fa5e49cf690>}
>>> show_avrmem(a['mem'])
{'desc': 'eeprom', 'paged': False, 'size': 1024, 'page_size': 4}
{'desc': 'flash', 'paged': True, 'size': 32768, 'page_size': 128}
{'desc': 'lfuse', 'paged': False, 'size': 1, 'page_size': 1}
{'desc': 'hfuse', 'paged': False, 'size': 1, 'page_size': 1}
{'desc': 'efuse', 'paged': False, 'size': 1, 'page_size': 1}
{'desc': 'lock', 'paged': False, 'size': 1, 'page_size': 1}
{'desc': 'signature', 'paged': False, 'size': 3, 'page_size': 1}
{'desc': 'calibration', 'paged': False, 'size': 1, 'page_size': 1}
{'desc': 'io', 'paged': False, 'size': 224, 'page_size': 1}
{'desc': 'sram', 'paged': False, 'size': 2048, 'page_size': 1}
>>> exit()

@mcuee
Copy link
Collaborator

mcuee commented Mar 6, 2024

@dl8dtl

I tried to push a quick fix for the macOS CI failure but it does not work -- it still uses the system installed Python and not Homebrew Python.

And I have the same linking issue under my Mac Mini M1 (macOS 14.3.1). It uses System Python and not Homebrew Python.

The root cause is missing the link to the python library.
https://stackoverflow.com/questions/14782925/compiling-c-with-swig-on-mac-os-x

I can manually fix the issue but I do not know how to do that properly in CMake.

@mcuee
Copy link
Collaborator

mcuee commented Mar 6, 2024

The root cause is missing the link to the python library. https://stackoverflow.com/questions/14782925/compiling-c-with-swig-on-mac-os-x

I can manually fix the issue but I do not know how to do that properly in CMake.

Basically we need to add the found PythonLibs in the linking step of build _swig_avrdude.so.

github action run:
https://github.com/avrdudes/avrdude/actions/runs/8171968929/job/22341326157?pr=1714

Found PythonLibs: /usr/local/Frameworks/Python.framework/Versions/3.12/lib/libpython3.12.dylib
...
[ 99%] Linking C shared module _swig_avrdude.so
...

@dl8dtl
Copy link
Contributor Author

dl8dtl commented Mar 6, 2024

Basically we need to add the found PythonLibs in the linking step of build _swig_avrdude.so.

Thanks for the analysis, very welcome! I'm almost illiterate regarding CMake.
I won't be able to look at all this before tonight European time though.

@mcuee
Copy link
Collaborator

mcuee commented Mar 6, 2024

The root cause is missing the link to the python library. https://stackoverflow.com/questions/14782925/compiling-c-with-swig-on-mac-os-x
I can manually fix the issue but I do not know how to do that properly in CMake.

Basically we need to add the found PythonLibs in the linking step of build _swig_avrdude.so.

@dl8dtl

I tried a dirty fix but it does not work. Sorry I do not know how to fix this issue, but at least we know the root cause now for macOS build.

@mcuee
Copy link
Collaborator

mcuee commented Mar 6, 2024

Basically we need to add the found PythonLibs in the linking step of build _swig_avrdude.so.

Thanks for the analysis, very welcome! I'm almost illiterate regarding CMake. I won't be able to look at all this before tonight European time though.

No issues, same here -- not knowing much about CMake or SWIG myself...

@mcuee
Copy link
Collaborator

mcuee commented Mar 6, 2024

I only know libftdi SWIG Python bindings working under macOS. Not so sure if it will help or not.
https://github.com/mcuee/libftdi/blob/master/python/CMakeLists.txt

However, I can see that Homebrew libftdi formula actually disables the building of SWIG based Python binding.

@dl8dtl
Copy link
Contributor Author

dl8dtl commented Mar 6, 2024

What's a little strange here:

find_package(SWIG 4.0 COMPONENTS python)
if(SWIG_FOUND)
  find_package(PythonLibs REQUIRED)
  if(PYTHONLIBS_FOUND)
    set(HAVE_SWIG 1)
  endif()
endif()

I'd have expected that the "REQUIRED" there would actually require a Python library … but on my Mac, there isn't one, and so I get the same linker error.

@mcuee
Copy link
Collaborator

mcuee commented Mar 7, 2024

@dl8dtl

Indeed it is strange.

You can always leave the build isse aside first and concentrate on the code development first. If the build error is too distracting, you can temporarily remove the build from github action as well (macOS, Windows MSVC and Windows MSYS2 mingw build).

@dl8dtl
Copy link
Contributor Author

dl8dtl commented Mar 7, 2024

You can always leave the build isse aside first and concentrate on the code development first.

Yes, that's probably what it's going to be by now. There's not much point spending time there as long as it isn't clear whether the entire result will be useful at all.

This helps the SWIG wrapper to define them as well.
Some library functions might return AVRMEM* and AVRPART* as
NULL pointers. Prevent them from being dereferenced, and
return a Python None object instead.
@mcuee
Copy link
Collaborator

mcuee commented Mar 7, 2024

Looking at the MSVC build errors, it seems to me it is due to missing extra Windows extra include files for the SWIG Python Wrapper build.

https://github.com/avrdudes/avrdude/tree/main/src/msvc

After manually corrected the include directories (basically copy the MSVC include directories of libavrdude msvc project to swig_avrdude msvc project), the following is the output (missing Python library).

Rebuild started at 7:56 am...
1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: RelWithDebInfo x64 ------
1>1>Checking Build System
2>------ Rebuild All started: Project: libusb, Configuration: RelWithDebInfo x64 ------
3>------ Rebuild All started: Project: libhidapi, Configuration: RelWithDebInfo x64 ------
4>------ Rebuild All started: Project: libftdi, Configuration: RelWithDebInfo x64 ------
5>------ Rebuild All started: Project: libelf, Configuration: RelWithDebInfo x64 ------
2>Building Custom Rule C:/work/avr/avrdude_test/avrdude_jw/build_msvc/_deps/libusb-src/CMakeLists.txt
3>Building Custom Rule C:/work/avr/avrdude_test/avrdude_jw/build_msvc/_deps/libhidapi-src/CMakeLists.txt
4>Building Custom Rule C:/work/avr/avrdude_test/avrdude_jw/build_msvc/_deps/libftdi-src/CMakeLists.txt
5>Building Custom Rule C:/work/avr/avrdude_test/avrdude_jw/build_msvc/_deps/libelf-src/CMakeLists.txt
2>descriptors.c
3>hid.c
4>ftdi.cpp
5>32.fsize.c
2>error.c
5>32.getehdr.c
5>32.getphdr.c
5>32.getshdr.c
5>32.newehdr.c
5>32.newphdr.c
5>32.xlatetof.c
5>64.xlatetof.c
2>registry.c
5>assert.c
5>begin.c
5>checksum.c
3>libhidapi.vcxproj -> C:\work\avr\avrdude_test\avrdude_jw\build_msvc\_deps\libhidapi-build\RelWithDebInfo\libhidapi.lib
5>cntl.c
5>cook.c
4>libftdi.vcxproj -> C:\work\avr\avrdude_test\avrdude_jw\build_msvc\_deps\libftdi-build\RelWithDebInfo\libftdi.lib
5>data.c
5>end.c
5>errmsg.c
5>errno.c
5>fill.c
5>flag.c
2>usb.c
5>gelfehdr.c
5>Generating Code...
2>Generating Code...
2>windows.cpp
5>Compiling...
5>gelfphdr.c
5>gelfshdr.c
5>gelftrans.c
5>getarhdr.c
5>getaroff.c
5>getarsym.c
5>getbase.c
5>getdata.c
5>getident.c
5>getscn.c
5>hash.c
5>input.c
5>kind.c
5>memset.c
5>ndxscn.c
5>newdata.c
5>newscn.c
5>next.c
5>nextscn.c
5>nlist.c
5>Generating Code...
5>Compiling...
5>opt.delscn.c
2>libusb.vcxproj -> C:\work\avr\avrdude_test\avrdude_jw\build_msvc\_deps\libusb-build\RelWithDebInfo\libusb.lib
5>rand.c
5>rawdata.c
5>rawfile.c
5>strptr.c
5>swap64.c
5>update.c
5>verdef_32_tof.c
5>verdef_32_tom.c
5>verdef_64_tof.c
5>verdef_64_tom.c
5>version.c
5>x.elfext.c
5>x.movscn.c
5>x.remscn.c
5>Generating Code...
5>libelf.vcxproj -> C:\work\avr\avrdude_test\avrdude_jw\build_msvc\_deps\libelf-build\RelWithDebInfo\libelf.lib
6>------ Rebuild All started: Project: swig_avrdude, Configuration: RelWithDebInfo x64 ------
6>Swig compile libavrdude.i for python
6>C:\work\avr\avrdude_test\avrdude_jw\src\libavrdude.i(54): warning 462: Unable to set variable of type char []
6>C:\work\avr\avrdude_test\avrdude_jw\src\libavrdude.i(58): warning 451: Setting a const char * variable may leak memory.
6>C:\work\avr\avrdude_test\avrdude_jw\src\libavrdude.i(59): warning 451: Setting a const char * variable may leak memory.
6>[FLEX][Parser] Building scanner with win_flex 2.6.3
6>[BISON][Parser] Building parser with bison 2.7
6>Building Custom Rule C:/work/avr/avrdude_test/avrdude_jw/src/CMakeLists.txt
6>libavrdudePYTHON_wrap.c
6>arduino.c
6>avr.c
6>avr910.c
6>avrcache.c
6>avrftdi.c
6>avrftdi_tpi.c
6>avrintel.c
6>avrpart.c
6>bitbang.c
6>buspirate.c
6>butterfly.c
6>ch341a.c
6>config.c
6>confwin.c
6>crc16.c
6>dfu.c
6>dryrun.c
6>fileio.c
6>flip1.c
6>Generating Code...
6>Compiling...
6>flip2.c
6>ft245r.c
6>jtagmkI.c
6>jtagmkII.c
6>jtag3.c
6>leds.c
6>linuxgpio.c
6>linuxspi.c
6>lists.c
6>micronucleus.c
6>par.c
6>pgm.c
6>pgm_type.c
6>pickit2.c
6>pindefs.c
6>ppi.c
6>ppiwin.c
6>serbb_posix.c
6>serbb_win32.c
6>ser_avrdoper.c
6>Generating Code...
6>Compiling...
6>ser_posix.c
6>ser_win32.c
6>serialadapter.c
6>serialupdi.c
6>stk500.c
6>stk500v2.c
6>stk500generic.c
6>strutil.c
6>teensy.c
6>term.c
6>updi_link.c
6>updi_nvm.c
6>updi_nvm_v0.c
6>updi_nvm_v2.c
6>updi_nvm_v3.c
6>updi_nvm_v4.c
6>updi_nvm_v5.c
6>updi_readwrite.c
6>updi_state.c
6>urclock.c
6>Generating Code...
6>Compiling...
6>usbasp.c
6>usb_hidapi.c
6>usb_libusb.c
6>usbtiny.c
6>update.c
6>wiring.c
6>xbee.c
6>lexer.c
6>config_gram.c
6>getopt.c
6>gettimeofday.c
6>Generating Code...
6>usleep.cpp
6>readline.cpp
6>Generating Code...
6>LINK : fatal error LNK1104: cannot open file 'python311.lib'
6>Done building project "swig_avrdude.vcxproj" -- FAILED.
========== Rebuild All: 5 succeeded, 1 failed, 0 skipped ==========
========== Rebuild completed at 7:56 am and took 10.603 seconds ==========

Then after manually adding the Python library, the build is actually successful.

Build started at 8:02 am...
1>------ Build started: Project: swig_avrdude, Configuration: RelWithDebInfo x64 ------
1>   Creating library C:/work/avr/avrdude_test/avrdude_jw/build_msvc/src/RelWithDebInfo/swig_avrdude.lib and object C:/work/avr/avrdude_test/avrdude_jw/build_msvc/src/RelWithDebInfo/swig_avrdude.exp
1>swig_avrdude.vcxproj -> C:\work\avr\avrdude_test\avrdude_jw\build_msvc\src\RelWithDebInfo\_swig_avrdude.pyd
========== Build: 1 succeeded, 0 failed, 5 up-to-date, 0 skipped ==========
========== Build completed at 8:02 am and took 00.826 seconds ==========

@mcuee
Copy link
Collaborator

mcuee commented Mar 8, 2024

Then it seems to work even though I have to patch swigtest.py a bit to get it working.

PS C:\work\avr\avrdude_test\avrdude_jw> python .\src\swigtest.py
Traceback (most recent call last):
  File "C:\work\avr\avrdude_test\avrdude_jw\src\swigtest.py", line 17, in <module>
    sysname = os.uname()[0].lower()
              ^^^^^^^^
AttributeError: module 'os' has no attribute 'uname'. Did you mean: 'name'?
PS C:\work\avr\avrdude_test\avrdude_jw> python -i .\src\swigtest.py
Found avrdude.conf in build_msvc/src
>>> a=search_avrpart('m328')
>>> print(a)
{'desc': 'ATmega328', 'id': 'm328', 'signature': b'\x1e\x95\x14', 'mem': <Swig Object of type 'struct avrmem *' at 0x000001DBC57961F0>}
>>> show_avrmem(a['mem'])
{'desc': 'eeprom', 'paged': False, 'size': 1024, 'page_size': 4}
{'desc': 'flash', 'paged': True, 'size': 32768, 'page_size': 128}
{'desc': 'lfuse', 'paged': False, 'size': 1, 'page_size': 1}
{'desc': 'hfuse', 'paged': False, 'size': 1, 'page_size': 1}
{'desc': 'efuse', 'paged': False, 'size': 1, 'page_size': 1}
{'desc': 'lock', 'paged': False, 'size': 1, 'page_size': 1}
{'desc': 'signature', 'paged': False, 'size': 3, 'page_size': 1}
{'desc': 'calibration', 'paged': False, 'size': 1, 'page_size': 1}
{'desc': 'io', 'paged': False, 'size': 224, 'page_size': 1}
{'desc': 'sram', 'paged': False, 'size': 2048, 'page_size': 1}
>>> exit()
PS C:\work\avr\avrdude_test\avrdude_jw> git diff
diff --git a/src/swigtest.py b/src/swigtest.py
index 73f3ea42..bfe53b16 100644
--- a/src/swigtest.py
+++ b/src/swigtest.py
@@ -14,8 +14,9 @@ import sys
 import os
 import pathlib

-sysname = os.uname()[0].lower()
-builddir = f'build_{sysname}/src'
+#sysname = os.uname()[0].lower()
+#builddir = f'build_{sysname}/src'
+builddir = f'build_msvc/src'

 sys.path.append(builddir)

Adding the build directory to the module search path eases development
by now.
Not really understood, but with level MSG_TRACE2, on a Curiosity Nano
board, I get two instances of unicode decode errors within the trace
messages. Trying to debug them did not yield any useful result, but
catching the exception, and enforcing the type to be "str" appear to
be able to continue.

Maybe an internal bug of my Python interpreter, don't know.
These are debugging functions, and not supposed to print at
MSG_INFO level.
@mcuee
Copy link
Collaborator

mcuee commented Apr 9, 2024

missing: Python3_EXECUTABLE

Cannot use the interpreter "C:/work/python/py311x64venv/Scripts/python.exe"

This is interesting (unexpected interesting).

Indeed this is quite strange.

In general case, if something doesn't work because of CMake (and no "nice" workaround is possible) but can be achieved by tweaking some CMake variables - better to tweak them using external scripts. I.E.: best to update the build_msvc.cmd and pass -DPython3_FIND_REGISTRY=NEVER since build_msvc.cmd is responsible for settings the venv (right?), etc.

Yes, build.cmd is my build script for MSVC.

It seems to me the following seems to always working under Windows.
(Note: -D Python3_ROOT_DIR may not be necessary but I have not tested all cases).

Example: Virtual Env

cmake -D Python3_ROOT_DIR="c:\work\python\py310x64venv" -D Python3_FIND_REGISTRY=NEVER -D DEBUG_CMAKE=1 -D CMAKE_SYSTEM_VERSION=11 -D USE_EXTERNAL_LIBS=1  -D CMAKE_BUILD_TYPE=RelWithDebInfo -B build_msvc_python310

cmake --build build_msvc_python310 --config RelWithDebInfo

Example: no Virtual Env

cmake -D Python3_ROOT_DIR="c:\Python310" -D Python3_FIND_REGISTRY=NEVER -D DEBUG_CMAKE=1 -D CMAKE_SYSTEM_VERSION=11 -D USE_EXTERNAL_LIBS=1  -D CMAKE_BUILD_TYPE=RelWithDebInfo -B build_msvc_python310_nonvenv

cmake --build build_msvc_python310_novenv --config RelWithDebInfo

@mcuee
Copy link
Collaborator

mcuee commented Apr 9, 2024

I cannot find any workaround to build for virtual env other than the virtual env generated by the default version of python.

You can see if keeps find the default Home Brew Python (/opt/homebrew/bin/python3.12).

(py310venv) mcuee@mcuees-Mac-mini avrdude_jw % which python
/Users/mcuee/build/python/py310venv/bin/python
(py310venv) mcuee@mcuees-Mac-mini avrdude_jw % python3 --version
Python 3.10.14

(py310venv) mcuee@mcuees-Mac-mini avrdude_jw % cat build_darwin_py310venv.sh 
cmake -D Python3_ROOT_DIR="/Users/mcuee/build/python/py310venv" -D Python3_FIND_VIRTUALENV=FIRST  -D Python3_FIND_FRAMEWORK=NEVER \
      -D CMAKE_C_FLAGS=-I/opt/homebrew/include -D CMAKE_EXE_LINKER_FLAGS=-L/opt/homebrew/Cellar \
      -D DEBUG_CMAKE=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo \
      -B build_darwin_py310venv
cmake --build build_darwin_py310venv

(py310venv) mcuee@mcuees-Mac-mini avrdude_jw % ./build_darwin_py310venv.sh  
-- The C compiler identification is AppleClang 15.0.0.15000309
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Git: /opt/homebrew/bin/git (found version "2.44.0")
-- Found FLEX: /usr/bin/flex (found version "2.6.4")
-- Found BISON: /usr/bin/bison (found version "2.3")
-- Looking for libelf.h
-- Looking for libelf.h - not found
-- Looking for libelf/libelf.h
-- Looking for libelf/libelf.h - found
-- Looking for usb.h
-- Looking for usb.h - found
-- Looking for lusb0_usb.h
-- Looking for lusb0_usb.h - not found
-- Looking for libusb.h
-- Looking for libusb.h - not found
-- Looking for libusb-1.0/libusb.h
-- Looking for libusb-1.0/libusb.h - found
-- Looking for hidapi/hidapi.h
-- Looking for hidapi/hidapi.h - found
-- Looking for ftdi_tcioflush
-- Looking for ftdi_tcioflush - found
-- Found SWIG: /opt/homebrew/bin/swig (found suitable version "4.2.1", minimum required is "4.0") found components: python
-- Found Python3: /opt/homebrew/bin/python3.12 (found version "3.12.2") found components: Interpreter Development Development.Module Development.Embed
-- Configuration summary:
-- ----------------------
-- CMAKE_HOST_SYSTEM: Darwin-23.4.0
-- CMAKE_SYSTEM: Darwin-23.4.0
-- CMAKE_FIND_ROOT_PATH: 
-- CMAKE_C_COMPILER: /Library/Developer/CommandLineTools/usr/bin/cc
-- CONFIG_DIR: /usr/local/etc
-- AVRDUDE_FULL_VERSION: 7.3-20240408 (5227dbe6)
-- USE_EXTERNAL_LIBS: OFF
-- USE_LIBUSBWIN32: OFF
-- HAVE_LIBELF: /opt/homebrew/lib/libelf.a
-- HAVE_LIBUSB: /opt/homebrew/lib/libusb.dylib
-- HAVE_LIBUSB_1_0: /opt/homebrew/lib/libusb-1.0.dylib
-- HAVE_LIBUSB_WIN32: HAVE_LIBUSB_WIN32-NOTFOUND
-- HAVE_LIBHIDAPI: /opt/homebrew/lib/libhidapi.dylib
-- HAVE_LIBFTDI: HAVE_LIBFTDI-NOTFOUND
-- HAVE_LIBFTDI1: /opt/homebrew/lib/libftdi1.dylib
-- HAVE_LIBREADLINE: /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/lib/libreadline.tbd
-- HAVE_LIBSERIALPORT: 1
-- HAVE_LIBELF_H: 
-- HAVE_LIBELF_LIBELF_H: 1
-- HAVE_USB_H: 1
-- HAVE_LUSB0_USB_H: 
-- HAVE_LIBUSB_H: 
-- HAVE_LIBUSB_1_0_LIBUSB_H: 1
-- HAVE_HIDAPI_HIDAPI_H: 1
-- LIBUSB_COMPAT_DIR: 
-- HAVE_LIBGPIOD: 
-- ----------------------
-- DO HAVE    libelf
-- DO HAVE    libusb
-- DO HAVE    libusb_1_0
-- DO HAVE    libhidapi
-- DON'T HAVE libftdi
-- DO HAVE    libftdi1
-- DO HAVE    libreadline
-- DO HAVE    libserialport
-- DISABLED   doc
-- DISABLED   parport
-- DISABLED   linuxgpio
-- DISABLED   linuxspi
-- DO HAVE    swig+Python3
-- ----------------------
-- Configuring done (1.4s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/mcuee/build/avr/avrdude_test/avrdude_jw/build_darwin_py310venv
...

@mcuee
Copy link
Collaborator

mcuee commented Apr 9, 2024

Okay, last resort works. I need to specify the Python3_EXECUTABLE.
https://cmake.org/cmake/help/latest/module/FindPython3.html

Artifacts Specification
New in version 3.16.

To solve special cases, it is possible to specify directly the artifacts by setting the following variables:

Python3_EXECUTABLE
The path to the interpreter.

(py310venv) mcuee@mcuees-Mac-mini avrdude_jw % python3 --version
Python 3.10.14
(py310venv) mcuee@mcuees-Mac-mini avrdude_jw % which python3
/Users/mcuee/build/python/py310venv/bin/python3

(py310venv) mcuee@mcuees-Mac-mini avrdude_jw % cat build_darwin_py310venv.sh 
cmake -D Python3_EXECUTABLE="/Users/mcuee/build/python/py310venv/bin/python" \
      -D CMAKE_C_FLAGS=-I/opt/homebrew/include -D CMAKE_EXE_LINKER_FLAGS=-L/opt/homebrew/Cellar \
      -D DEBUG_CMAKE=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo \
      -B build_darwin_py310venv
cmake --build build_darwin_py310venv

(py310venv) mcuee@mcuees-Mac-mini avrdude_jw % ./build_darwin_py310venv.sh 
-- The C compiler identification is AppleClang 15.0.0.15000309
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Git: /opt/homebrew/bin/git (found version "2.44.0")
-- Found FLEX: /usr/bin/flex (found version "2.6.4")
-- Found BISON: /usr/bin/bison (found version "2.3")
-- Looking for libelf.h
-- Looking for libelf.h - not found
-- Looking for libelf/libelf.h
-- Looking for libelf/libelf.h - found
-- Looking for usb.h
-- Looking for usb.h - found
-- Looking for lusb0_usb.h
-- Looking for lusb0_usb.h - not found
-- Looking for libusb.h
-- Looking for libusb.h - not found
-- Looking for libusb-1.0/libusb.h
-- Looking for libusb-1.0/libusb.h - found
-- Looking for hidapi/hidapi.h
-- Looking for hidapi/hidapi.h - found
-- Looking for ftdi_tcioflush
-- Looking for ftdi_tcioflush - found
-- Found SWIG: /opt/homebrew/bin/swig (found suitable version "4.2.1", minimum required is "4.0") found components: python
-- Found Python3: /Users/mcuee/build/python/py310venv/bin/python (found version "3.10.14") found components: Interpreter Development Development.Module Development.Embed
-- Configuration summary:
-- ----------------------
-- CMAKE_HOST_SYSTEM: Darwin-23.4.0
-- CMAKE_SYSTEM: Darwin-23.4.0
-- CMAKE_FIND_ROOT_PATH: 
-- CMAKE_C_COMPILER: /Library/Developer/CommandLineTools/usr/bin/cc
-- CONFIG_DIR: /usr/local/etc
-- AVRDUDE_FULL_VERSION: 7.3-20240408 (5227dbe6)
-- USE_EXTERNAL_LIBS: OFF
-- USE_LIBUSBWIN32: OFF
-- HAVE_LIBELF: /opt/homebrew/lib/libelf.a
-- HAVE_LIBUSB: /opt/homebrew/lib/libusb.dylib
-- HAVE_LIBUSB_1_0: /opt/homebrew/lib/libusb-1.0.dylib
-- HAVE_LIBUSB_WIN32: HAVE_LIBUSB_WIN32-NOTFOUND
-- HAVE_LIBHIDAPI: /opt/homebrew/lib/libhidapi.dylib
-- HAVE_LIBFTDI: HAVE_LIBFTDI-NOTFOUND
-- HAVE_LIBFTDI1: /opt/homebrew/lib/libftdi1.dylib
-- HAVE_LIBREADLINE: /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/lib/libreadline.tbd
-- HAVE_LIBSERIALPORT: 1
-- HAVE_LIBELF_H: 
-- HAVE_LIBELF_LIBELF_H: 1
-- HAVE_USB_H: 1
-- HAVE_LUSB0_USB_H: 
-- HAVE_LIBUSB_H: 
-- HAVE_LIBUSB_1_0_LIBUSB_H: 1
-- HAVE_HIDAPI_HIDAPI_H: 1
-- LIBUSB_COMPAT_DIR: 
-- HAVE_LIBGPIOD: 
-- ----------------------
-- DO HAVE    libelf
-- DO HAVE    libusb
-- DO HAVE    libusb_1_0
-- DO HAVE    libhidapi
-- DON'T HAVE libftdi
-- DO HAVE    libftdi1
-- DO HAVE    libreadline
-- DO HAVE    libserialport
-- DISABLED   doc
-- DISABLED   parport
-- DISABLED   linuxgpio
-- DISABLED   linuxspi
-- DO HAVE    swig+Python3
-- ----------------------
-- Configuring done (1.1s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/mcuee/build/avr/avrdude_test/avrdude_jw/build_darwin_py310venv
...
...

[100%] Built target swig_avrdude

(py310venv) mcuee@mcuees-Mac-mini avrdude_jw % otool -L ./build_darwin_py310venv/src/_swig_avrdude.so 
./build_darwin_py310venv/src/_swig_avrdude.so:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.100.2)
	/opt/homebrew/opt/libusb-compat/lib/libusb-0.1.4.dylib (compatibility version 9.0.0, current version 9.4.0)
	/opt/homebrew/opt/libusb/lib/libusb-1.0.0.dylib (compatibility version 5.0.0, current version 5.0.0)
	/opt/homebrew/opt/hidapi/lib/libhidapi.0.dylib (compatibility version 0.0.0, current version 0.14.0)
	/opt/homebrew/opt/libftdi/lib/libftdi1.2.dylib (compatibility version 2.0.0, current version 2.5.0)
	/usr/lib/libedit.3.dylib (compatibility version 2.0.0, current version 3.0.0)
	/opt/homebrew/opt/libserialport/lib/libserialport.0.dylib (compatibility version 2.0.0, current version 2.0.0)
	/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
	/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/Python (compatibility version 3.10.0, current version 3.10.0)

CMakeCache.txt

@mcuee
Copy link
Collaborator

mcuee commented Apr 13, 2024

Hmm, now it does not work under Linux out of the box, no matter I use virtual environment or not. Strange.

(mypy39venv) mcuee@UbuntuSwift3 ~/build/avr/avrdude_jw (swig_libavrdude)$ ./build.sh 
-- The C compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Git: /usr/bin/git (found version "2.25.1")
-- Found FLEX: /usr/bin/flex (found version "2.6.4")
-- Found BISON: /usr/bin/bison (found version "3.5.1")
-- Looking for libelf.h
-- Looking for libelf.h - found
-- Looking for libelf/libelf.h
-- Looking for libelf/libelf.h - not found
-- Looking for usb.h
-- Looking for usb.h - found
-- Looking for lusb0_usb.h
-- Looking for lusb0_usb.h - not found
-- Looking for libusb.h
-- Looking for libusb.h - not found
-- Looking for libusb-1.0/libusb.h
-- Looking for libusb-1.0/libusb.h - found
-- Looking for hidapi/hidapi.h
-- Looking for hidapi/hidapi.h - found
-- Looking for ftdi_tcioflush
-- Looking for ftdi_tcioflush - found
-- Found SWIG: /usr/bin/swig4.0 (found suitable version "4.0.1", minimum required is "4.0") found components: python
-- Could NOT find Python3 (missing: Python3_INCLUDE_DIRS Python3_LIBRARIES Development Development.Module Development.Embed) (found version "3.9.13")
-- Found SWIG but no Python3 header/library; cannot use SWIG
-- Configuration summary:
-- ----------------------
-- DO HAVE    libelf
-- DO HAVE    libusb
-- DO HAVE    libusb_1_0
-- DO HAVE    libhidapi
-- DON'T HAVE libftdi
-- DO HAVE    libftdi1
-- DO HAVE    libreadline
-- DO HAVE    libserialport
-- DISABLED   doc
-- DISABLED   parport
-- DISABLED   linuxgpio
-- DISABLED   linuxspi
-- DON'T HAVE swig+Python3
-- ----------------------
-- Configuring done (1.2s)
-- Generating done (0.0s)
-- Build files have been written to: /home/mcuee/build/avr/avrdude_jw/build_linux
...

@mcuee
Copy link
Collaborator

mcuee commented Apr 13, 2024

It seems to me only the default Python version is working (with or without virtual environment). Under Ubuntu 20.04, the default version is Python 3.8.

(mypy38venv) mcuee@UbuntuSwift3 ~/build/avr/avrdude_jw (swig_libavrdude)$ which python
/home/mcuee/build/python/mypy38venv/bin/python
(mypy38venv) mcuee@UbuntuSwift3 ~/build/avr/avrdude_jw (swig_libavrdude)$ python --version
Python 3.8.10

(mypy38venv) mcuee@UbuntuSwift3 ~/build/avr/avrdude_jw (swig_libavrdude)$ cat build_python38_venv.sh 
cmake -D Python3_EXECUTABLE="/home/mcuee/build/python/mypy38venv/bin/python" \
      -D DEBUG_CMAKE=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo \
      -B build_linux_py38venv
cmake --build build_linux_py38venv

(mypy38venv) mcuee@UbuntuSwift3 ~/build/avr/avrdude_jw (swig_libavrdude)$ ./build_python38.sh 
-- The C compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Git: /usr/bin/git (found version "2.25.1")
-- Found FLEX: /usr/bin/flex (found version "2.6.4")
-- Found BISON: /usr/bin/bison (found version "3.5.1")
-- Looking for libelf.h
-- Looking for libelf.h - found
-- Looking for libelf/libelf.h
-- Looking for libelf/libelf.h - not found
-- Looking for usb.h
-- Looking for usb.h - found
-- Looking for lusb0_usb.h
-- Looking for lusb0_usb.h - not found
-- Looking for libusb.h
-- Looking for libusb.h - not found
-- Looking for libusb-1.0/libusb.h
-- Looking for libusb-1.0/libusb.h - found
-- Looking for hidapi/hidapi.h
-- Looking for hidapi/hidapi.h - found
-- Looking for ftdi_tcioflush
-- Looking for ftdi_tcioflush - found
-- Found SWIG: /usr/bin/swig4.0 (found suitable version "4.0.1", minimum required is "4.0") found components: python
-- Found Python3: /usr/bin/python3 (found version "3.8.10") found components: Interpreter Development Development.Module Development.Embed
-- Configuration summary:
-- ----------------------
-- CMAKE_HOST_SYSTEM: Linux-5.15.0-101-generic
-- CMAKE_SYSTEM: Linux-5.15.0-101-generic
-- CMAKE_FIND_ROOT_PATH: 
-- CMAKE_C_COMPILER: /usr/bin/cc
-- CONFIG_DIR: /usr/local/etc
-- AVRDUDE_FULL_VERSION: 7.3-20240408 (5227dbe6)
-- USE_EXTERNAL_LIBS: OFF
-- USE_LIBUSBWIN32: OFF
-- HAVE_LIBELF: /usr/lib/x86_64-linux-gnu/libelf.so
-- HAVE_LIBUSB: /usr/local/lib/libusb.so
-- HAVE_LIBUSB_1_0: /usr/local/lib/libusb-1.0.so
-- HAVE_LIBUSB_WIN32: HAVE_LIBUSB_WIN32-NOTFOUND
-- HAVE_LIBHIDAPI: /usr/local/lib/libhidapi-libusb.so
-- HAVE_LIBFTDI: HAVE_LIBFTDI-NOTFOUND
-- HAVE_LIBFTDI1: /usr/local/lib/libftdi1.so
-- HAVE_LIBREADLINE: /usr/lib/x86_64-linux-gnu/libreadline.so
-- HAVE_LIBSERIALPORT: 1
-- HAVE_LIBELF_H: 1
-- HAVE_LIBELF_LIBELF_H: 
-- HAVE_USB_H: 1
-- HAVE_LUSB0_USB_H: 
-- HAVE_LIBUSB_H: 
-- HAVE_LIBUSB_1_0_LIBUSB_H: 1
-- HAVE_HIDAPI_HIDAPI_H: 1
-- LIBUSB_COMPAT_DIR: 
-- HAVE_LIBGPIOD: 
-- ----------------------
-- DO HAVE    libelf
-- DO HAVE    libusb
-- DO HAVE    libusb_1_0
-- DO HAVE    libhidapi
-- DON'T HAVE libftdi
-- DO HAVE    libftdi1
-- DO HAVE    libreadline
-- DO HAVE    libserialport
-- DISABLED   doc
-- DISABLED   parport
-- DISABLED   linuxgpio
-- DISABLED   linuxspi
-- DO HAVE    swig+Python3
-- ----------------------
-- Configuring done (0.6s)
-- Generating done (0.0s)
-- Build files have been written to: /home/mcuee/build/avr/avrdude_jw/build_linux_py38
...
...
(mypy38venv) mcuee@UbuntuSwift3 ~/build/avr/avrdude_jw (swig_libavrdude)$ ldd ./build_linux_py38venv/src/_swig_avrdude.so 
	linux-vdso.so.1 (0x00007fffc4cc5000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6ab0d31000)
	libelf.so.1 => /lib/x86_64-linux-gnu/libelf.so.1 (0x00007f6ab0d15000)
	libusb-0.1.so.4 => /usr/local/lib/libusb-0.1.so.4 (0x00007f6ab0d0d000)
	libusb-1.0.so.0 => /usr/local/lib/libusb-1.0.so.0 (0x00007f6ab0ced000)
	libhidapi-libusb.so.0 => /usr/local/lib/libhidapi-libusb.so.0 (0x00007f6ab0ce2000)
	libftdi1.so.2 => /usr/local/lib/libftdi1.so.2 (0x00007f6ab0ccf000)
	libreadline.so.8 => /lib/x86_64-linux-gnu/libreadline.so.8 (0x00007f6ab0c7f000)
	libserialport.so.0 => /usr/local/lib/libserialport.so.0 (0x00007f6ab0c6c000)
	libpython3.8.so.1.0 => /lib/x86_64-linux-gnu/libpython3.8.so.1.0 (0x00007f6ab0716000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6ab0524000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f6ab1378000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f6ab0508000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6ab0500000)
	libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007f6ab04d3000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6ab04b0000)
	libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f6ab0480000)
	libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f6ab0452000)
	libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f6ab044d000)

(mypy38venv) mcuee@UbuntuSwift3 ~/build/avr/avrdude_jw (swig_libavrdude)$ sudo cmake --build build_linux_py38venv --target install
[  1%] Built target conf
[ 49%] Built target libavrdude
[ 51%] Built target avrdude
[ 52%] Built target swig_avrdude_swig_compilation
[100%] Built target swig_avrdude
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/local/bin/avrdude
-- Set non-toolchain portion of runtime path of "/usr/local/bin/avrdude" to ""
-- Installing: /usr/local/lib/libavrdude.a
-- Installing: /usr/local/include/libavrdude.h
-- Up-to-date: /usr/local/include/libavrdude-avrintel.h
-- Installing: /usr/local/etc/avrdude.conf
-- Up-to-date: /usr/local/share/man/man1/avrdude.1
-- Installing: /home/mcuee/build/python/mypy38venv/lib/python3.8/site-packages/_swig_avrdude.so
-- Set non-toolchain portion of runtime path of "/home/mcuee/build/python/mypy38venv/lib/python3.8/site-packages/_swig_avrdude.so" to ""
-- Installing: /home/mcuee/build/python/mypy38venv/lib/python3.8/site-packages/swig_avrdude.py
-- Installing: /usr/local/share/avrdude
-- Installing: /usr/local/share/avrdude/askfuse.ui
-- Installing: /usr/local/share/avrdude/adgui.ui
-- Installing: /usr/local/share/avrdude/help.ui
-- Installing: /usr/local/share/avrdude/programmer.ui
-- Installing: /usr/local/share/avrdude/about.ui
-- Installing: /usr/local/share/avrdude/devinfo.ui
-- Installing: /usr/local/share/avrdude/device.ui
-- Installing: /usr/local/share/avrdude/loglevel.ui
-- Installing: /usr/local/share/avrdude/memories.ui
-- Up-to-date: /usr/local/share/avrdude
-- Installing: /usr/local/share/avrdude/adgui.py
-- Installing: /usr/local/share/avrdude/swigtest.py
-- Installing: /usr/local/bin/avrdude-gui

src/libavrdude.h Outdated Show resolved Hide resolved
src/libavrdude.h Outdated Show resolved Hide resolved
That way, users can operate the GUI while the help window is
displaying.
Some fuse settings on some devices may be dangerous, like
disabling ISP, or changing the /RESET pin into a GPIO.

This adds some warning examples. Still does not consider
the actual programmer connection, but that could be added
in future.
Remove obsolete avrdude_message().
Place inline comments at position 32.
Changes have been suggested by Stefan Rueger.
Make the combo box editable, and apply a QValidator subclass
to it so the users can type partial device names.
The default of 10 entries is way too small.
While the combobox validator prevents "QValidator.Invalid"
characters to be entered, the user could still get away with
any string that is considered "QValidator.Intermediate". In
that caes, disable the OK button of the button box so the
(intermediate) result could not be passed on.
Turns out PySide2 doesn't have a setMarkdown() method for the text widgets,
only setHtml().
50 seemed to be a bit too large for some displays.
While typing the combobox text, the validator adapts the contents of
the dropdown menu to only those entries that match the text typed.
So one can enter "64", and will only be presented all device that
have a 64 in their name (which are a few more than just those with
64 KiB of flash).
This category triggers for all programmers that have PM_SPM
set.
This offers the same feature as for the device selection: typing
a partial programmer name filters the dropdown list to all
possible matches for a programmer.
Was:

Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created.
@stefanrueger
Copy link
Collaborator

@dl8dtl @mcuee @MCUdude I have created 27 PRs, one for each programmer, to bring them up to speed for use in the GUI:

  • Removing exit() calls
  • Moving static variables to programmer private PDATA ares (so they get re-initialised when a programmer is restarted)
  • Fixing memory leaks
  • Abstracting malloc/realloc/free/strdup calls with #define's in avrdude.h so they can be replaced by the GUI if it wants to
  • Ensuring double teardowns() don't harm (though I am sure this GUI doesn't do that)

When you review new programmer code in future please remember to watch out for exit(), static or global variables etc. With serious libavrdude use these can no longer be here.

Please, if you can, give those PRs a quick test. @mcuee already has tested quite a few (thanks!) but he doesn't have all gear.

@stefanrueger
Copy link
Collaborator

There are still quite a few other things to do once these PRs are merged: the new return code LIBAVRDUDE_EXIT needs to be picked up in nested libavrdude functions and passed back to the top caller (main.c for the AVRDUDE project) where it needs to exit(0)/end the session. The remaining exit() calls in the non-programmer related libavrdude functions still need to be removed and the remaining static and global functions gathered into a context structure. But that is outside programmers and can be tested with -c dryrun, so doesn't need that many PRs.

As to names (always the most tricky part of programming 😄): I'd like to use

typedef struct libavrdude_context {
  // All global and static variables that are used (ca 70)
} cx_t;

This must be allocated at the start of an application and only one global variable used: cx_t *cx. So, it will be cx->verbose instead of verbose. A future version of libavrdude might have cx as the first parameter for each function, so that one application can handle many programming instances in parallel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants