Misc: Fix testlibusb build on VS2013 and earlier and suppress warnings
authorChris Dickens <christopher.a.dickens@gmail.com>
Wed, 27 Dec 2017 07:58:00 +0000 (23:58 -0800)
committerChris Dickens <christopher.a.dickens@gmail.com>
Wed, 27 Dec 2017 07:58:00 +0000 (23:58 -0800)
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
examples/testlibusb.c
libusb/version_nano.h
msvc/config.h

index df5bb84..893203a 100755 (executable)
 #include <string.h>
 #include "libusb.h"
 
+#if defined(_MSC_VER) && (_MSC_VER < 1900)
+#define snprintf _snprintf
+#endif
+
 int verbose = 0;
 
 static void print_endpoint_comp(const struct libusb_ss_endpoint_companion_descriptor *ep_comp)
index bc3ae8f..0029bd2 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11230
+#define LIBUSB_NANO 11231
index dc9280e..7a374b3 100644 (file)
 
 /* Disable: warning C4200: nonstandard extension used : zero-sized array in struct/union */
 #pragma warning(disable:4200)
+/* Disable: warning C4324: structure was padded due to __declspec(align()) */
+#pragma warning(disable:4324)
 /* Disable: warning C6258: Using TerminateThread does not allow proper thread clean up */
-#pragma warning(disable: 6258)
+#pragma warning(disable:6258)
 /* Disable: warning C4996: 'GetVersionA': was declared deprecated */
-#pragma warning(disable: 4996)
+#pragma warning(disable:4996)
 
 #if defined(_PREFAST_)
 /* Disable "Banned API" errors when using the MS's WDK OACR/Prefast */