Commit graph

12 commits

Author SHA1 Message Date
Vas Crabb
b5475eb38b Various updates, mostly around Lua:
Compile Lua as C++.  When Lua is compiled as C, it uses setjmp/longjmp
for error handling, resulting in failure to unwind intermediate stack
frames.  Trying to ensure no objects with non-trivial destructors are in
scope when raising a Lua error is error-prone.  In particular,
converting an exception to a Lua error becomes convoluted, and raising a
Lua error from a constructor is effectively impossible.

Updated Lua to 5.4.4 - this includes a brand-new garbage collector
implementation with better performance.  The main thing removed is the
deprecated bitlib.

Updated sol2 to version 3.3.0 - this adds support for Lua 5.4 and fixes
a number of issues, including not correctly handling errors when Lua is
built as C++.

Updated LuaFileSystem to version 1.8.0 - this adds support for symbolic
links on Windows, as well as Lua 5.4 compatibility.

Updated LuaSQLite3 to version 0.9.5 - this fixes issues in
multi-threaded environments, as well as Lua 5.4 compatibility.

Fixed double-free after attempting to construct a debugger expression
from Lua with an invalid string, and exposed expression error to Lua in
a better way.

Added warning level print function to Lua.

Fixed saving cheats with shift operators in expressions, although this
code isn't actually used as there's no cheat editor.
2023-03-07 01:39:42 +11:00
Vas Crabb
f191d038ec Minimal changes to sol2 and bgfx to compile as C++17.
These changes should be sent upstream as pull requests.
2020-11-15 03:57:08 +11:00
Vas Crabb
55b8ca317a -Switch to building MAME as C++17.
* Updated sol2 to 3.2.2
* Updated pugixml to 1.10
* Increased minimum clang version to 6
* Cleaned up some stuff that can use new features
2020-11-15 03:53:47 +11:00
AJR
dcbee7cda6 Fix SOL2 build on GCC 10.2 by working around overload resolution problem 2020-07-28 20:33:25 -04:00
feos
d51d2a71d5 luaengine: reduce memory usage during compilation
Previous semantics were encouraged by sol2, and ThePhD admitted it was a bad idea for usertypes with lots of members. sol3 allows to assign members outside a constructor for regular usertypes, but mame can't move to sol3 because it requires C++17. Turns out sol2 also has a way to add members separately, and that is what I used. This helps immensely.

This approach required a fix to warning C5046 copied from here 5799084572

Tested current mame plugins, everything seems to work.

PS: Due to come black magic, if I use simple_usertype::set() with "manager" as well, "machine" member dies (others are fine!), so I had to leave it intact.
2019-10-19 11:37:01 +03:00
Miodrag Milanovic
ac096aa2a0 Update sol2 (nw) 2017-02-05 16:06:06 +01:00
cracyc
a68d423992 luaengine: use initializers (nw) 2016-11-15 22:21:07 -06:00
cracyc
673e753621 update sol2 (nw) 2016-11-07 13:31:30 -06:00
cracyc
196c841dcb update sol2 (nw) 2016-11-06 18:57:12 -06:00
cracyc
6fd9586a89 make safe usertypes safer (nw) 2016-11-06 13:31:37 -06:00
Miodrag Milanovic
c2a75cb179 Updated sol2, made lua console not crash for nil data (nw) 2016-11-06 10:05:36 +01:00
Miodrag Milanovic
377472a6dd Added sol2 header only library as future replacement for luabridge (nw) 2016-10-07 14:43:09 +02:00