lean4-htt/src/cmake/Modules/CheckLuaObjlen.cc
Leonardo de Moura a10aa0880f fix(build): add CheckLuaObjlen.cc test, not every Lua version has the function lua_objlen
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-08 08:26:04 -08:00

20 lines
442 B
C++

/*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#include <iostream>
#include <memory>
#include <lua.hpp>
// Little program for checking whether lua_objlen is available
int main() {
lua_State * L;
L = luaL_newstate();
lua_newtable(L);
if (lua_objlen(L, -1) == 0)
return 0;
else
return 1;
}