Windows: Fix GCC printf format warnings due to DWORD/ULONG types
authorChris Dickens <christopher.a.dickens@gmail.com>
Sun, 26 Jan 2020 22:31:35 +0000 (14:31 -0800)
committerChris Dickens <christopher.a.dickens@gmail.com>
Sun, 26 Jan 2020 22:31:35 +0000 (14:31 -0800)
commit80d2238cb80469aee03d0367080350496d8548eb
treeefd84ff3c454b0e437b773bc3248a248d9e5fb2c
parenta96937af9935c569b679d8ada2f59e90754b700a
Windows: Fix GCC printf format warnings due to DWORD/ULONG types

The Visual Studio compiler considers a long to always be 32-bits, so the
official Windows API headers define the DWORD and ULONG types as
unsigned long proper. GCC (and possibly other compilers) vary the width
of a long to match the build target, so this complicates printf format
strings for these two types because the underlying type is inconsistent.

Address this mess by introducing a macro that casts as necessary for the
compiler.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/os/poll_windows.c
libusb/os/windows_common.c
libusb/os/windows_common.h
libusb/os/windows_winusb.c
libusb/version_nano.h