diff --git a/Makefile b/Makefile index 57f19da3..f2afed00 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ endif OBJ := $(SRC:.c=.o) # define default flags, and override to append mandatory flags -override CFLAGS := -O3 -std=gnu99 -fPIC -Wall -Wextra -Werror -Wshadow $(CFLAGS) +override CFLAGS := -O3 -std=gnu99 -fPIC -fvisibility=hidden -Wall -Wextra -Werror -Wshadow $(CFLAGS) override CFLAGS += -Ilib/src -Ilib/include # ABI versioning diff --git a/lib/include/tree_sitter/api.h b/lib/include/tree_sitter/api.h index 9e936ff8..1cc6b3e9 100644 --- a/lib/include/tree_sitter/api.h +++ b/lib/include/tree_sitter/api.h @@ -1,6 +1,8 @@ #ifndef TREE_SITTER_API_H_ #define TREE_SITTER_API_H_ +#pragma GCC visibility push(default) + #ifdef __cplusplus extern "C" { #endif @@ -1163,4 +1165,6 @@ void ts_set_allocator( } #endif +#pragma GCC visibility pop + #endif // TREE_SITTER_API_H_