Windows: Fix ssize_t unconditionally defined
authorPaul Cercueil <paul@crapouillou.net>
Wed, 6 Oct 2021 13:31:24 +0000 (14:31 +0100)
committerTormod Volden <debian.tormod@gmail.com>
Sat, 30 Oct 2021 13:21:56 +0000 (15:21 +0200)
The standard procedure to define ssize_t on Windows is to wrap it around
a check for the _SSIZE_T_DEFINED macro.

If not done, it makes it impossible to use the libusb.h header along
with other headers (from other libraries) that also attempt to define
ssize_t.

Closes #1007

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
libusb/libusb.h
libusb/version_nano.h

index 5ea699f..0b3d854 100644 (file)
 #define inline __inline
 #endif
 /* ssize_t is also not available */
+#ifndef _SSIZE_T_DEFINED
+#define _SSIZE_T_DEFINED
 #include <basetsd.h>
 typedef SSIZE_T ssize_t;
+#endif /* _SSIZE_T_DEFINED */
 #endif /* _MSC_VER */
 
 #include <limits.h>
index 191a7e7..922dca9 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11659
+#define LIBUSB_NANO 11660