add windows (MSVC) configuration

Update makefiles
This commit is contained in:
2024-02-25 08:37:36 -06:00
parent 9b245b10e3
commit f18610d526
7 changed files with 102 additions and 38 deletions

View File

@@ -92,13 +92,15 @@ struct KiwiExpression {
KiwiTerm terms[];
static constexpr std::size_t sz(int count) {
return sizeof(KiwiExpression) + sizeof(KiwiTerm) * (count > 0 ? count : 0);
return sizeof(KiwiExpression)
+ sizeof(KiwiTerm) * static_cast<std::size_t>(count > 0 ? count : 0);
}
#else
KiwiTerm terms[1];
static constexpr std::size_t sz(int count) {
return sizeof(KiwiExpression) + sizeof(KiwiTerm) * (count > 1 ? count - 1 : 0);
return sizeof(KiwiExpression)
+ sizeof(KiwiTerm) * static_cast<std::size_t>(count > 0 ? count : 0);
}
#endif

View File

@@ -1607,6 +1607,8 @@ void compat_init(lua_State*, int) {}
#if defined __GNUC__ && (!defined _WIN32 || defined __CYGWIN__)
#define LJKIWI_EXPORT __attribute__((__visibility__("default")))
#elif defined _WIN32
#define LJKIWI_EXPORT __declspec(dllexport)
#endif
extern "C" LJKIWI_EXPORT int luaopen_ljkiwi(lua_State* L) {