Skip to content

Commit f02ddc3

Browse files
committed
Fix function export for msvc build
1 parent b28adf6 commit f02ddc3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/luasimdjson.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
#include <lua.hpp>
2+
3+
#ifdef _MSC_VER
4+
#define LUASIMDJSON_EXPORT __declspec(dllexport)
5+
#else
6+
#define LUASIMDJSON_EXPORT extern
7+
#endif
8+
29
extern "C" {
310
static int parse(lua_State*);
411
static int parse_file(lua_State*);
512
static int active_implementation(lua_State*);
613
static int ParsedObject_open(lua_State*);
714
static int ParsedObject_open_file(lua_State*);
815

9-
1016
static const struct luaL_Reg luasimdjson[] = {
1117
{"parse", parse},
1218
{"parseFile", parse_file},
1319
{"activeImplementation", active_implementation},
1420
{"open", ParsedObject_open},
1521
{"openFile", ParsedObject_open_file},
16-
22+
1723
{NULL, NULL},
1824
};
19-
int luaopen_simdjson (lua_State*);
25+
LUASIMDJSON_EXPORT int luaopen_simdjson(lua_State*);
2026
}

0 commit comments

Comments
 (0)