5
我在我的代码中处理皮秒(数字大于10^12)。
C代码将数据传递到Lua(atime的和事件ID都为size_t类型的)Lua C api:处理大量数字
lua_getglobal (luactx, "timer_callback");
lua_pushunsigned (luactx, atime);
lua_pushunsigned (luactx, eventid);
lua_pcall (luactx, 2, 0, 0);
的Lua功能
function timer_callback(time, eventid)
if eventid == TX_CLOCK then
out_log(tostring(time)) --result is random garbage
set_callback(time + 1000000000000, TX_CLOCK)
return
end
end
我试图调用lua_pushnumber但结果在LUA我得到负数。
lua的哪个版本? 5.3支持'lua_Integer',默认是64位。 – indiv 2014-09-23 16:44:01
我使用5.2下的Win32 – pugnator 2014-09-23 16:45:05
个人,请将您的消息作为答案。我只是从源代码构建5.3,重新编译我的应用程序,所有工作都像一个魅力 – pugnator 2014-09-23 17:01:21