From 21f17e871ea3de419f682a8088337ba6ae1d015e Mon Sep 17 00:00:00 2001 From: Jude Melton-Houghton Date: Thu, 7 Apr 2022 10:54:17 -0400 Subject: Compile Lua as C++ (#11683) Co-authored-by: sfan5 --- lib/lua/src/luaconf.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'lib/lua/src/luaconf.h') diff --git a/lib/lua/src/luaconf.h b/lib/lua/src/luaconf.h index e2cb26163..1521f0cbc 100644 --- a/lib/lua/src/luaconf.h +++ b/lib/lua/src/luaconf.h @@ -143,6 +143,14 @@ #define LUA_INTEGER ptrdiff_t +/* MINETEST-SPECIFIC CHANGE: make sure API functions conform to the C ABI. */ +#if defined(__cplusplus) +#define LUAI_API_EXTERN extern "C" +#else +#define LUAI_API_EXTERN extern +#endif + + /* @@ LUA_API is a mark for all core API functions. @@ LUALIB_API is a mark for all standard library functions. @@ -154,14 +162,14 @@ #if defined(LUA_BUILD_AS_DLL) #if defined(LUA_CORE) || defined(LUA_LIB) -#define LUA_API __declspec(dllexport) +#define LUA_API LUAI_API_EXTERN __declspec(dllexport) #else -#define LUA_API __declspec(dllimport) +#define LUA_API LUAI_API_EXTERN __declspec(dllimport) #endif #else -#define LUA_API extern +#define LUA_API LUAI_API_EXTERN #endif -- cgit v1.2.3