Declare snprintf to fix builds on macOS
For some reason on macOS, the functions `snprintf` and `vsnprintf` are not in the X/Open 5 (ANSI C89) standard but rather in the X/Open 6 (ISO C99). A simplest solution seems to be to declaring the missing functions before using them, which is what I did here. Another option is to use the C99 standard with `#define _XOPEN_SOURCE 600`, which seems to be an overkill for such a niche issue. Quoting from the STANDARDS section in `man 3 snprintf` on macOS: > ...the snprintf() and vsnprintf() functions conform to ISO/IEC > 9899:1999 (“ISO C99”)...
This commit is contained in:
parent
ce0cc5a352
commit
d2e054346f
|
@ -26,6 +26,10 @@
|
|||
#define PATH_MAX 4096
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
int snprintf(char *, unsigned long, const char *, ...);
|
||||
#endif
|
||||
|
||||
#include "../uxn.h"
|
||||
#include "file.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue