1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Compile Lua as C++ (#11683)

Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
Jude Melton-Houghton 2022-04-07 10:54:17 -04:00 committed by GitHub
parent 837cea6b4a
commit 21f17e871e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 103 additions and 34 deletions

View file

@ -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