diff options
Diffstat (limited to 'src/uscxml/plugins')
-rw-r--r-- | src/uscxml/plugins/datamodel/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/uscxml/plugins/datamodel/CMakeLists.txt b/src/uscxml/plugins/datamodel/CMakeLists.txt index e70598e..a03e7c8 100644 --- a/src/uscxml/plugins/datamodel/CMakeLists.txt +++ b/src/uscxml/plugins/datamodel/CMakeLists.txt @@ -72,7 +72,7 @@ if (V8_FOUND) endif() -if (LUA51_FOUND AND WITH_DM_LUA) +if (LUA_FOUND AND WITH_DM_LUA) set(USCXML_DATAMODELS "lua ${USCXML_DATAMODELS}") # Lua ecmascript datamodel file(GLOB LUA_DATAMODEL diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp index 4f78e7d..92866ee 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp +++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp @@ -163,9 +163,10 @@ static luabridge::LuaRef getDataAsLua(lua_State* _luaState, const Data& data) { luaData = luabridge::newTable(_luaState); std::map<std::string, Data>::const_iterator compoundIter = data.compound.begin(); while(compoundIter != data.compound.end()) { - if (isInteger(compoundIter->first.c_str(), 10) && strTo<size_t>(compoundIter->first) > 0) { + if (isInteger(compoundIter->first.c_str(), 10) && strTo<long>(compoundIter->first) > 0) { // it makes a difference whether we pass a numeric string or a proper number! - luaData[strTo<size_t>(compoundIter->first)] = getDataAsLua(_luaState, compoundIter->second); + // MSVC throws assertion with LuaBridge for size_t instead of int + luaData[strTo<long>(compoundIter->first)] = getDataAsLua(_luaState, compoundIter->second); } else { luaData[compoundIter->first] = getDataAsLua(_luaState, compoundIter->second); } |