Skip to content

Commit 4ff7cfd

Browse files
authored
[make] Enable -fvisibility=hidden (#108)
This prevents symbols being exported by default, potentially resulting in more optimal code with a reduced binary size. This also matches msvc behaviour.
1 parent 942038a commit 4ff7cfd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
OBJ = src/luasimdjson.o src/simdjson.o
22
CPPFLAGS = -I$(LUA_INCDIR)
3-
CXXFLAGS = -std=c++11 -Wall $(CFLAGS)
3+
CXXFLAGS = -std=c++11 -Wall -fvisibility=hidden $(CFLAGS)
44
LDFLAGS = $(LIBFLAG)
55
LDLIBS = -lpthread
66

src/luasimdjson.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#ifdef _MSC_VER
44
#define LUASIMDJSON_EXPORT __declspec(dllexport)
55
#else
6-
#define LUASIMDJSON_EXPORT extern
6+
#define LUASIMDJSON_EXPORT __attribute__((visibility("default")))
77
#endif
88

99
extern "C" {
@@ -23,4 +23,4 @@ extern "C" {
2323
{NULL, NULL},
2424
};
2525
LUASIMDJSON_EXPORT int luaopen_simdjson(lua_State*);
26-
}
26+
}

0 commit comments

Comments
 (0)