diff --git a/src/factory.c b/src/factory.c index 083a80aa..5451178c 100644 --- a/src/factory.c +++ b/src/factory.c @@ -145,7 +145,16 @@ do { \ 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. diff --git a/src/factory.h b/src/factory.h index ee72f878..6609771d 100644 --- a/src/factory.h +++ b/src/factory.h @@ -15,4 +15,4 @@ void Run_numbered_script(byte index); /// /// Returns a string stating the included Lua engine version, /// or "Disabled" if Grafx2 is compiled without Lua. -const char * Lua_version(void); \ No newline at end of file +const char * Lua_version(void);