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:
tree-sitter-ci-bot[bot] 2025-03-02 23:46:23 +01:00 committed by GitHub
parent 781dc0570d
commit 6f2dbaab5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View file

@ -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"