Skip to content

Commit 153c5da

Browse files
committed
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.
1 parent bfc11e6 commit 153c5da

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

uhubctl.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*/
1111

12-
#define _XOPEN_SOURCE 500
12+
#define _XOPEN_SOURCE 600
1313

1414
#include <stdio.h>
1515
#include <stdlib.h>
@@ -35,10 +35,6 @@
3535
#include <libusb-1.0/libusb.h>
3636
#endif
3737

38-
#if defined(__APPLE__) || defined(__FreeBSD__) /* snprintf is not available in pure C mode */
39-
int snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4);
40-
#endif
41-
4238
#if !defined(LIBUSB_API_VERSION) || (LIBUSB_API_VERSION <= 0x01000103)
4339
#define LIBUSB_DT_SUPERSPEED_HUB 0x2a
4440
#endif

0 commit comments

Comments
 (0)