Spring Lua backwards compatibility

Spring Lua backwards compatibility

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Spring Lua backwards compatibility

Post by trepan »

The backwards compatibility COMPAT defines in luaconf.h
were removed with the r6079 commit. That means that all
widgets, gadgets, and lua based defs files will need to be
updated if they use any related code. For what it's worth,
I cleaned up all of the lua code in SVN in less than an hour,
so it's not that hard to do.

Code: Select all

/*
@@ LUA_COMPAT_VARARG controls compatibility with old vararg feature.
** CHANGE it to undefined as soon as your programs use only '...' to
** access vararg parameters (instead of the old 'arg' table).
*/
//SPRING
#undef LUA_COMPAT_VARARG

/*
@@ LUA_COMPAT_MOD controls compatibility with old math.mod function.
** CHANGE it to undefined as soon as your programs use 'math.fmod' or
** the new '%' operator instead of 'math.mod'.
*/
//SPRING
#undef LUA_COMPAT_MOD

/*/*
@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.
** CHANGE it to undefined as soon as you rename 'string.gfind' to
** 'string.gmatch'.
*/
//SPRING
#undef LUA_COMPAT_GFIND

@@ LUA_COMPAT_LSTR controls compatibility with old long string nesting
@* facility.
** CHANGE it to 2 if you want the old behaviour, or undefine it to turn
** off the advisory error when nesting [[...]].
*/
//SPRING
#undef LUA_COMPAT_LSTR
Post Reply

Return to “Lua Scripts”