From a25edef5ea1a3c72d53302301a8aaf77062fb7ac Mon Sep 17 00:00:00 2001 From: Jin Qing Date: Tue, 7 Jun 2016 16:07:46 +0800 Subject: [PATCH] Add extern C and dllexport for luaopen(). --- binding/lua53/pbc-lua53.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/binding/lua53/pbc-lua53.c b/binding/lua53/pbc-lua53.c index d0de051..88a0a03 100644 --- a/binding/lua53/pbc-lua53.c +++ b/binding/lua53/pbc-lua53.c @@ -864,6 +864,13 @@ _add_rmessage(lua_State *L) { return 0; } +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__) +__declspec(dllexport) +#endif int luaopen_protobuf_c(lua_State *L) { luaL_Reg reg[] = { @@ -904,3 +911,7 @@ luaopen_protobuf_c(lua_State *L) { return 1; } + +#ifdef __cplusplus +} +#endif