Fixes support of Lua 5.0 and 5.1, and a compilation warning on Linux

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2005 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2012-09-22 17:51:37 +00:00
parent 01690f7df1
commit f7d9cc1a90
2 changed files with 11 additions and 2 deletions

View File

@ -145,7 +145,16 @@ do { \
const char * Lua_version(void) const char * Lua_version(void)
{ {
return LUA_VERSION_MAJOR "." LUA_VERSION_MINOR; // LUA_RELEASE is only available since 5.2+, with format "Lua x.y.z"
// The only version information available since Lua 5.0 is LUA_VERSION,
// with the format "Lua x.y"
#if defined(LUA_RELEASE)
return LUA_RELEASE;
#elif defined (LUA_VERSION)
return LUA_VERSION;
#else
return "Unknown";
#endif
} }
// Updates the screen colors after a running screen has modified the palette. // Updates the screen colors after a running screen has modified the palette.

View File

@ -15,4 +15,4 @@ void Run_numbered_script(byte index);
/// ///
/// Returns a string stating the included Lua engine version, /// Returns a string stating the included Lua engine version,
/// or "Disabled" if Grafx2 is compiled without Lua. /// or "Disabled" if Grafx2 is compiled without Lua.
const char * Lua_version(void); const char * Lua_version(void);