the new Lua directors feature uses lua_setuservalue, added in Lua 5.2.
Removing the LUA_VERSION_NUM-guarded compatibility defines for lua_rawlen,
lua_pushglobaltable and lua_rawsetp/lua_rawgetp from Lib/lua/luarun.swg.
LuaJIT implements the Lua 5.1 API and, per its own documentation, is
"API+ABI-compatible with Lua 5.1, which prevents implementing features
that would otherwise break the Lua/C API and ABI" (https://luajit.org/extensions.html,
"Extensions from Lua 5.2" section) - so it never defines these Lua 5.2 additions.
Noticed when rebuilding obs-studio's LuaJIT-based Lua bindings against SWIG master.
Restore those compatibility defines, scoped to 5.1 and later only (the old
Lua 5.0-only shims are not restored).
Also revert an incidental ok!=LUA_OK comparison introduced by #3394
back to ok!=0, since LUA_OK isn't defined pre-5.2 either and luaL_dostring()
already returns 0 on success on every Lua version.
Fix the examples and test-suite where they themselves used Lua 5.2 only
features: LUA_OK in Examples/lua/embed/embed.c, _ENV in helpers.lua, and
string.format("%c", ...) in li_cdata_bytes, which yields an empty string for a
NUL byte in Lua 5.1 as strlen() is applied to the formatted result, so
string.char() is used instead.
Directors continue to require Lua 5.2 or later and are unaffected by this
change; the Lua 5.1 director test failures are addressed separately.
Assisted-by: Claude Code (Sonnet 5)
- Add Lua examples
- Add and fix unused Lua tests
- Add lua_module_global complementary test of lua_no_module_global
- Add Lua test-suite runme files
Enable friends_nested and minherit inline test code for Lua via the
SWIGLUA guards.
- configure.ac
- Use minimum version 5.2 for Lua
- Add lua 5.5, it was released in dec 2025
- Syntax improvements
- GHA CI
- Remove 'default' Lua version, it is confusing.
Just select the version explicitly.
- Add Lua 5.4 test, we need to test all supported versions 5.2, 5.3 and 5.4
Lua 5.5 is not available on Ubuntu yet.
- Lua documentation Doc/Manual/Lua.html
- Update version to 5.2
- Remove mention to older SWIG version,
whom wishes to go to the very old history can look on CHANGES.
- Add references on missing operators in Lua.
- _ENV exist from Lua 5.2.
- Remove old compatibility code from Lib/lua/luarun.swg.
- Remove LUA_VERSION_NUM from Lua C wrapping code.
It was used for old Lua 5.0 and Lua 5.1.
- Remove _VERSION from Lua tests.
Note: _VERSION remains a keyword and developers may use it in interface files!
- Remove Example/lua/import.lua and Examples/test-suite/lua/import.lua
as they are not used or needed any longer.
- Remove old Lua import.
- Add Examples/test-suite/lua/helpers.lua
- include it in all tests in test-suite.
- Add catch "undefined" global variables enable function.
- Add import_to_globs function.
To add module functions, variables and classes to global scope.
- Remove the -squash-bases option as it is broken
The der.new_func from the example
in the document, "29.3.18.3 Inheritance",
pass from base object to derived object
regardless of using the flag or not.
- Remove -no-old-metatable-bindings as it is deprecated in the last 12 years
Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
Avoid using reserved identifiers such as `_DOHINT_H` (fixes#1989),
fix cases where the name doesn't match the filename, and make the naming
more consistent and less likely to collide with include guards in other
headers.
Complete the prototype removal in ca1431.
The script prevents SWIGTOOL=gdb from working as gdb can't be used to
debug a shell script, it requires a binary.
Add support for SWIGTOOL in all the examples.
SWIG_LIB_DIR and SWIGEXE must now instead be set by all Makefiles.
See issue #473.
- Examples/Makefile.in rules use SRCDIR as the relative source directory
- ./config.status replicates Examples/ source directory tree in build
directory, and copies each Makefile to build directory, prefixed with
a header which sets SRCDIR to source directory
- Examples/test-suite/.../Makefile.in set SRCDIR from Autoconf-set srcdir
- Examples/test-suite/errors/Makefile.in needs to filter out source
directory from SWIG error messages
- Lua: embedded interpreters are passed location of run-time test
- Python: copy run-time scripts to build directory because of 2to3
conversion; import_packages example copies __init__.py from source
directory; test-suite sets SCRIPTDIR to location of run-time tests
- Javascript: binding.gyp renamed to binding.gyp.in so that $srcdir
can be substituted with SRCDIR; removed './' from require() statements
so that NODE_PATH can be used to point Node.js to build directory
Fixed imports test case & added run test.
Added Examples/imports.
Added typename for raw lua_State*
Added documentation on native functions.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9748 626c5289-ae23-0410-ae9c-e8d60b6d4f22