mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 23:13:13 +02:00
lua: add compatibility to lua 5.3 and 5.4; copy from https://github.com/SteveKChiu/lua-intf/blob/master/LuaIntf/LuaCompat.h
This commit is contained in:
@@ -37,6 +37,15 @@
|
||||
#include "lua_cc_window.h"
|
||||
#include "lua_cc_text.h"
|
||||
|
||||
|
||||
#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */
|
||||
|
||||
#ifndef luaL_checkint
|
||||
# define luaL_checkint luaL_checkinteger
|
||||
#endif
|
||||
|
||||
#endif /* Lua 5.3 */
|
||||
|
||||
CLuaInstCCText* CLuaInstCCText::getInstance()
|
||||
{
|
||||
static CLuaInstCCText* LuaInstCCText = NULL;
|
||||
|
@@ -33,6 +33,14 @@
|
||||
#include "luainstance.h"
|
||||
#include "lua_cc_window.h"
|
||||
|
||||
#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */
|
||||
|
||||
#ifndef luaL_checkint
|
||||
#define luaL_checkint luaL_checkinteger
|
||||
#endif
|
||||
|
||||
#endif /* Lua 5.3 */
|
||||
|
||||
CLuaInstCCWindow* CLuaInstCCWindow::getInstance()
|
||||
{
|
||||
static CLuaInstCCWindow* LuaInstCCWindow = NULL;
|
||||
|
@@ -30,6 +30,14 @@
|
||||
#include "luainstance.h"
|
||||
#include "lua_configfile.h"
|
||||
|
||||
#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */
|
||||
|
||||
#ifndef luaL_checkint
|
||||
#define luaL_checkint luaL_checkinteger
|
||||
#endif
|
||||
|
||||
#endif /* Lua 5.3 */
|
||||
|
||||
CLuaInstConfigFile* CLuaInstConfigFile::getInstance()
|
||||
{
|
||||
static CLuaInstConfigFile* LuaInstConfigFile = NULL;
|
||||
|
@@ -35,6 +35,14 @@
|
||||
#include "luainstance.h"
|
||||
#include "lua_filehelpers.h"
|
||||
|
||||
#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */
|
||||
|
||||
#ifndef luaL_checkint
|
||||
#define luaL_checkint luaL_checkinteger
|
||||
#endif
|
||||
|
||||
#endif /* Lua 5.3 */
|
||||
|
||||
CLuaInstFileHelpers* CLuaInstFileHelpers::getInstance()
|
||||
{
|
||||
static CLuaInstFileHelpers* LuaInstFileHelpers = NULL;
|
||||
|
@@ -40,6 +40,14 @@
|
||||
/* autogenerated from luainstance.h */
|
||||
#include "lua_api_version.h"
|
||||
|
||||
#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */
|
||||
|
||||
#ifndef luaL_checkint
|
||||
#define luaL_checkint luaL_checkinteger
|
||||
#endif
|
||||
|
||||
#endif /* Lua 5.3 */
|
||||
|
||||
extern CVolume* g_volume;
|
||||
|
||||
CLuaInstMisc* CLuaInstMisc::getInstance()
|
||||
|
@@ -62,6 +62,33 @@
|
||||
/* autogenerated from luainstance.h */
|
||||
#include "lua_api_version.h"
|
||||
|
||||
#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */
|
||||
|
||||
#ifndef luaL_checkint
|
||||
# define luaL_checkint luaL_checkinteger
|
||||
#endif
|
||||
|
||||
#ifndef lua_pushunsigned
|
||||
#define lua_pushunsigned(L, n) \
|
||||
lua_pushinteger(L, static_cast<lua_Integer>(n))
|
||||
|
||||
#define lua_tounsignedx(L, i, is) \
|
||||
static_cast<lua_Unsigned>(lua_tointegerx(L, i, is))
|
||||
|
||||
#define lua_tounsigned(L, i) \
|
||||
lua_tounsignedx(L, (i), nullptr)
|
||||
#endif
|
||||
|
||||
#ifndef luaL_checkunsigned
|
||||
#define luaL_checkunsigned(L, a) \
|
||||
static_cast<lua_Unsigned>(luaL_checkinteger(L, a))
|
||||
|
||||
#define luaL_optunsigned(L, a, d) \
|
||||
static_cast<lua_Unsigned>(luaL_optinteger(L, a, static_cast<lua_Integer>(d)))
|
||||
#endif
|
||||
|
||||
#endif /* Lua 5.3 */
|
||||
|
||||
extern CPictureViewer *g_PicViewer;
|
||||
extern cVideo *videoDecoder;
|
||||
|
||||
|
Reference in New Issue
Block a user