Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added support for automatically select Lua 5.2 is it's available, the…

…n falling back to checking for Lua 5.1 otherwise.
  • Loading branch information...
commit a9336bfd067fc56a8975a0ac8c88de693b0dbb6b 1 parent 7847b47
Robert OSFIELD authored
Showing with 7 additions and 5 deletions.
  1. +4 −2 CMakeLists.txt
  2. +3 −3 src/osgPlugins/lua/LuaScriptEngine.cpp
View
6 CMakeLists.txt
@@ -539,8 +539,10 @@ ELSE()
FIND_PACKAGE(Asio)
ENDIF()
FIND_PACKAGE(ZeroConf)
- #FIND_PACKAGE(Lua52)
- FIND_PACKAGE(Lua51)
+ FIND_PACKAGE(Lua52)
+ IF (NOT (LUA_LIBRARIES AND LUA_INCLUDE_DIR))
+ FIND_PACKAGE(Lua51)
+ ENDIF()
FIND_PACKAGE(V8)
FIND_PACKAGE(PythonLibs)
ENDIF()
View
6 src/osgPlugins/lua/LuaScriptEngine.cpp
@@ -17,8 +17,6 @@
using namespace lua;
-#define USE_USERDATA_FOR_POINTER 1
-
static int getProperty(lua_State * _lua)
{
const LuaScriptEngine* lse = reinterpret_cast<const LuaScriptEngine*>(lua_topointer(_lua, lua_upvalueindex(1)));
@@ -275,7 +273,9 @@ class PushStackValueVisitor : public osg::ValueObject::GetValueVisitor
virtual void apply(const osg::Matrixd& value) { _lsg->pushValue(value); }
};
-#define lua_rawlen lua_strlen
+#if LUA_VERSION_NUM<=501
+ #define lua_rawlen lua_strlen
+#endif
class GetStackValueVisitor : public osg::ValueObject::SetValueVisitor
{
Please sign in to comment.
Something went wrong with that request. Please try again.