mirror of
https://github.com/janet-lang/janet
synced 2025-11-07 11:03:04 +00:00
Fix build on NetBSD.
The NetBSD C library's headers do not expose extensions when compiling with -std=c99 (as opposed to -std=gnu99 or no -std= option), so define _NETBSD_SOURCE to get timegm, and functions that would otherwise require an _XOPEN_SOURCE definition, e.g. realpath. Note that, as with FreeBSD, you need gmake to compile janet on NetBSD, and can also install it from packages.
This commit is contained in:
@@ -38,4 +38,11 @@
|
||||
#define _XOPEN_SOURCE 500
|
||||
#endif
|
||||
|
||||
/* Needed for timegm and other extensions when building with -std=c99.
|
||||
* It also defines realpath, etc, which would normally require
|
||||
* _XOPEN_SOURCE >= 500. */
|
||||
#if !defined(_NETBSD_SOURCE) && defined(__NetBSD__)
|
||||
#define _NETBSD_SOURCE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user