---------------------------------------------------------------------------*/
| 115 | |
| 116 | /*---------------------------------------------------------------------------*/ |
| 117 | void lua_tinker::init_u64(lua_State *L) |
| 118 | { |
| 119 | const char* name = "__u64"; |
| 120 | lua_newtable(L); |
| 121 | |
| 122 | lua_pushstring(L, "__name"); |
| 123 | lua_pushstring(L, name); |
| 124 | lua_rawset(L, -3); |
| 125 | |
| 126 | lua_pushstring(L, "__tostring"); |
| 127 | lua_pushcclosure(L, tostring_u64, 0); |
| 128 | lua_rawset(L, -3); |
| 129 | |
| 130 | // 比较只会两边元表都是相同的元素才会进入比较 |
| 131 | lua_pushstring(L, "__eq"); |
| 132 | lua_pushcclosure(L, eq_u64, 0); |
| 133 | lua_rawset(L, -3); |
| 134 | |
| 135 | lua_pushstring(L, "__lt"); |
| 136 | lua_pushcclosure(L, lt_u64, 0); |
| 137 | lua_rawset(L, -3); |
| 138 | |
| 139 | lua_pushstring(L, "__le"); |
| 140 | lua_pushcclosure(L, le_u64, 0); |
| 141 | lua_rawset(L, -3); |
| 142 | |
| 143 | lua_setglobal(L, name); |
| 144 | } |
| 145 | |
| 146 | /*---------------------------------------------------------------------------*/ |
| 147 | /* excution */ |
nothing calls this directly
no test coverage detected