Fixed snprintf override which breaks on old MacOS

`snprintf` is available in Mac/FreeBSD headers only if _XOPEN_SOURCE is 600 or higher.
This closes #586.
This commit is contained in:
mvp
2024-09-12 10:42:23 -07:00
parent bfc11e6b05
commit 153c5da267

View File

@@ -9,7 +9,7 @@
*
*/
#define _XOPEN_SOURCE 500
#define _XOPEN_SOURCE 600
#include <stdio.h>
#include <stdlib.h>
@@ -35,10 +35,6 @@
#include <libusb-1.0/libusb.h>
#endif
#if defined(__APPLE__) || defined(__FreeBSD__) /* snprintf is not available in pure C mode */
int snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4);
#endif
#if !defined(LIBUSB_API_VERSION) || (LIBUSB_API_VERSION <= 0x01000103)
#define LIBUSB_DT_SUPERSPEED_HUB 0x2a
#endif