lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Jan 30, 2020 at 3:25 PM Gisle Vanem <gvanem@yahoo.no> wrote:

> How else should be do it?

This is the entire patch I use for statically linked Lua:

diff --git a/src/luaconf.h b/src/luaconf.h
index fd447cc..49e127c 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -251,7 +251,11 @@
 
 #else /* }{ */
 
+#ifdef __cplusplus
+#define LUA_API extern "C"
+#else
 #define LUA_API extern
+#endif
 
 #endif /* } */
 
It is similar to your approach. In the past, I used some other ways, but eventually I settled on this. Repeat, statically linked Lua.

Cheers,
V.