Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不支持windows? #2

Open
sss316 opened this issue Jul 18, 2015 · 10 comments
Open

不支持windows? #2

sss316 opened this issue Jul 18, 2015 · 10 comments

Comments

@sss316
Copy link

sss316 commented Jul 18, 2015

编译模版有问题

@sniperHW
Copy link
Owner

#ifndef _GETFUNC
#define _GETFUNC ({
__func func;
void *t = lua_touserdata(L,lua_upvalueindex(1));
memcpy(&func,t,sizeof(func));
func;
})
#endif

VC不支持这种用法。提取出来,替换_GETFUNC就行了

@sss316
Copy link
Author

sss316 commented Jul 19, 2015

#ifndef _GETFUNC
#define _GETFUNC {
void *t = lua_touserdata(L,lua_upvalueindex(1));
memcpy(&func,t,sizeof(func));
}
#endif

调用的地方:
__func func;
_GETFUNC
push_obj(L,(cla->*func)());
宏定义我拆分成这样,可以编译过去了,但是类注册不上,lua里面提示没定义。

@sss316
Copy link
Author

sss316 commented Jul 19, 2015

现在函数没问题,建议更新下,也支持windows下的类

@sniperHW
Copy link
Owner

拿下新

@sss316
Copy link
Author

sss316 commented Jul 21, 2015

升级啦?额,我用cocos2d-x3.6呢,-x的lua版本还是5.1.4
#define LUA_VERSION "Lua 5.1"
#define LUA_RELEASE "Lua 5.1.4"
#define LUA_VERSION_NUM 501
哎,兄台能支持下么,毕竟国内用5.1的还是居多。

@sss316
Copy link
Author

sss316 commented Jul 21, 2015

#if (LUA_VERSION_NUM<520)
... // 可以判断当前版本是否在5.2以下
#else
...
#endif

@sniperHW
Copy link
Owner

好了,试试,我没5.14

@sss316
Copy link
Author

sss316 commented Jul 21, 2015

http://www.lua.org/ftp/ 官网有下载,你之前的貌似是基于5.1做的

@sniperHW
Copy link
Owner

行了。51也跑过测试了

@sss316
Copy link
Author

sss316 commented Jul 22, 2015

多谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants