fix(lib): expose only symbols defined in api.h

This commit is contained in:
Andrew Hlynskyi 2023-08-17 15:01:47 +03:00
parent cbe805d82a
commit 5e3df64a46
2 changed files with 5 additions and 1 deletions

View file

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

View file

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