Skip to content

provide math functions deprecated by the lack of LUA_COMPAT_MATHLIB on Lua 5.5 #78

@luau-project

Description

@luau-project

Description

From Lua 5.2.0 up to Lua 5.4.8, the presence of several deprecated functions in the mathematical library are controlled by a few macros, turned on by default (via CFLAGS) in the released src/Makefile:

  • Lua 5.2: the macro LUA_COMPAT_ALL is turned on by default by

    CFLAGS= -O2 -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
  • Lua 5.3: the macro LUA_COMPAT_5_2 is turned on by default by

    CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
  • Lua 5.4: the macro LUA_COMPAT_5_3 is turned on by default by

    CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS)

However, on Lua 5.5, even though the macro LUA_COMPAT_MATH is able to keep such deprecated functions in the mathematical library, this macro has been turned off in both src/Makefile and src/luaconf.h:

Conclusion

Even though I'm not sure whether it is the role of lua-compat53 to backport such functions as a compatibility layer, but since these functions are turned on a standard Lua 5.2 - Lua 5.4 build, I think such funcs could be easily provided by lua-compat53 to keep compatibility at
https://github.com/lunarmodules/lua-compat-5.3/blob/9c6f75a88db1462ff655dc006588b25d3bc2a5be/compat53/module.lua

Note

I could try to help with a PR if there's interest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions