fix: exclude APIs that dup given file descriptors from WASI builds
WASI doesn't support `dup(2)` system call, so we cannot implement the
`print_dot_graph` and `print_dot_graphs` functions with exactly the same
semantics as in other platforms.
(cherry picked from commit 94a8262110)
This commit is contained in:
parent
d10308528d
commit
bf094bd98a
3 changed files with 15 additions and 6 deletions
|
|
@ -148,7 +148,7 @@ void ts_tree_print_dot_graph(const TSTree *self, int fd) {
|
|||
fclose(file);
|
||||
}
|
||||
|
||||
#else
|
||||
#elif !defined(__wasi__) // WASI doesn't support dup
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
|
|
@ -162,4 +162,11 @@ void ts_tree_print_dot_graph(const TSTree *self, int file_descriptor) {
|
|||
fclose(file);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void ts_tree_print_dot_graph(const TSTree *self, int file_descriptor) {
|
||||
(void)self;
|
||||
(void)file_descriptor;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue