Skip to content

Commit

Permalink
fix tolua++ build configuration for LUA_TABLE data type
Browse files Browse the repository at this point in the history
  • Loading branch information
dualface committed Jun 6, 2012
1 parent 791ee85 commit 165336f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lua/cocos2dx_support/LuaCocos2d.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
** Lua binding: Cocos2d
** Generated automatically by tolua++-1.0.92 on Mon Jun 4 16:28:40 2012.
** Generated automatically by tolua++-1.0.92 on Tue Jun 5 12:42:08 2012.
*/


Expand Down
18 changes: 18 additions & 0 deletions tools/tolua++/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,24 @@
<replacetoken><![CDATA[tolua_usertype(tolua_S,"LUA_TABLE");]]></replacetoken>
<replacevalue><![CDATA[]]></replacevalue>
</replace>
<replace file="LuaCocos2d.cpp">
<replacetoken><![CDATA[{
#ifdef __cplusplus
void* tolua_obj = Mtolua_new((LUA_TABLE)(tolua_ret));
tolua_pushusertype(tolua_S,tolua_obj,"LUA_TABLE");
tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(LUA_TABLE));
tolua_pushusertype(tolua_S,tolua_obj,"LUA_TABLE");
tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
}]]></replacetoken>
<replacevalue><![CDATA[]]></replacevalue>
</replace>
<replace file="LuaCocos2d.cpp">
<replacetoken><![CDATA[LUA_TABLE tolua_ret = (LUA_TABLE)]]></replacetoken>
<replacevalue><![CDATA[]]></replacevalue>
</replace>

<!-- remove unused header -->
<replace file="LuaCocos2d.cpp">
Expand Down
18 changes: 18 additions & 0 deletions tools/tolua++/build_macosx.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,24 @@
<replacetoken><![CDATA[tolua_usertype(tolua_S,"LUA_TABLE");]]></replacetoken>
<replacevalue><![CDATA[]]></replacevalue>
</replace>
<replace file="LuaCocos2d.cpp">
<replacetoken><![CDATA[{
#ifdef __cplusplus
void* tolua_obj = Mtolua_new((LUA_TABLE)(tolua_ret));
tolua_pushusertype(tolua_S,tolua_obj,"LUA_TABLE");
tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(LUA_TABLE));
tolua_pushusertype(tolua_S,tolua_obj,"LUA_TABLE");
tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
}]]></replacetoken>
<replacevalue><![CDATA[]]></replacevalue>
</replace>
<replace file="LuaCocos2d.cpp">
<replacetoken><![CDATA[LUA_TABLE tolua_ret = (LUA_TABLE)]]></replacetoken>
<replacevalue><![CDATA[]]></replacevalue>
</replace>

<!-- remove unused header -->
<replace file="LuaCocos2d.cpp">
Expand Down

0 comments on commit 165336f

Please sign in to comment.