build: do not define _POSIX_C_SOURCE on NetBSD (#4196)
It leads to missing symbols, see #4180.
(cherry picked from commit 2bf04d1f04)
---------
Co-authored-by: Thomas Klausner <wiz@gatalith.at>
This commit is contained in:
parent
781dc0570d
commit
6f2dbaab5f
2 changed files with 14 additions and 1 deletions
|
|
@ -18,16 +18,20 @@
|
|||
#if defined(HAVE_ENDIAN_H) || \
|
||||
defined(__linux__) || \
|
||||
defined(__GNU__) || \
|
||||
defined(__NetBSD__) || \
|
||||
defined(__OpenBSD__) || \
|
||||
defined(__CYGWIN__) || \
|
||||
defined(__MSYS__) || \
|
||||
defined(__EMSCRIPTEN__)
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
#define _NETBSD_SOURCE 1
|
||||
#endif
|
||||
|
||||
# include <endian.h>
|
||||
|
||||
#elif defined(HAVE_SYS_ENDIAN_H) || \
|
||||
defined(__FreeBSD__) || \
|
||||
defined(__NetBSD__) || \
|
||||
defined(__DragonFly__)
|
||||
|
||||
# include <sys/endian.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* On NetBSD, defining standard requirements like this removes symbols
|
||||
* from the namespace; however, we need non-standard symbols for
|
||||
* endian.h.
|
||||
*/
|
||||
#if defined(__NetBSD__) && defined(_POSIX_C_SOURCE)
|
||||
#undef _POSIX_C_SOURCE
|
||||
#endif
|
||||
|
||||
#include "tree_sitter/api.h"
|
||||
#include "./alloc.h"
|
||||
#include "./array.h"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue