Skip to content

xlua macos luajit 编译报错 #111

Description

@owllyi

一开始其他平台编译luajit报错lua_tointegerx 的static定义有问题,注释掉这段之后继续
#if LUA_VERSION_NUM < 502
/* static int64_t lua_tointegerx(lua_State *L, int idx, int *isnum) {
if (lua_isnumber(L, idx)) {
if (isnum) *isnum = 1;
return (int64_t)lua_tointeger(L, idx);
}
else {
if (isnum) *isnum = 0;
return 0;
}
} */

到后面又有报错,提示lua_tointegerx定义不清晰,看了下,macos下编译luajit,用的是lua5.1的代码,就会有问题
/Users/runner/work/xLua/xLua/build/sproto/lsproto.c:295:8: error: implicit declaration of function 'lua_tointegerx' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

想问下这里应该如何兼容各种情况呢?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions