| 449 | } |
| 450 | |
| 451 | LUALIB_API int luaopen_i64lib(lua_State* L) |
| 452 | { |
| 453 | #if LUA_VERSION_NUM == 501 |
| 454 | lua_newtable(L); |
| 455 | |
| 456 | lua_pushcfunction(L, int64_add); |
| 457 | lua_setfield(L, -2, "__add"); |
| 458 | |
| 459 | lua_pushcfunction(L, int64_sub); |
| 460 | lua_setfield(L, -2, "__sub"); |
| 461 | |
| 462 | lua_pushcfunction(L, int64_mul); |
| 463 | lua_setfield(L, -2, "__mul"); |
| 464 | |
| 465 | lua_pushcfunction(L, int64_div); |
| 466 | lua_setfield(L, -2, "__div"); |
| 467 | |
| 468 | lua_pushcfunction(L, int64_mod); |
| 469 | lua_setfield(L, -2, "__mod"); |
| 470 | |
| 471 | lua_pushcfunction(L, int64_unm); |
| 472 | lua_setfield(L, -2, "__unm"); |
| 473 | |
| 474 | lua_pushcfunction(L, int64_pow); |
| 475 | lua_setfield(L, -2, "__pow"); |
| 476 | |
| 477 | lua_pushcfunction(L, int64_tostring); |
| 478 | lua_setfield(L, -2, "__tostring"); |
| 479 | |
| 480 | lua_pushcfunction(L, int64_eq); |
| 481 | lua_setfield(L, -2, "__eq"); |
| 482 | |
| 483 | lua_pushcfunction(L, int64_lt); |
| 484 | lua_setfield(L, -2, "__lt"); |
| 485 | |
| 486 | lua_pushcfunction(L, int64_le); |
| 487 | lua_setfield(L, -2, "__le"); |
| 488 | |
| 489 | lua_rawseti(L, LUA_REGISTRYINDEX, INT64_META_REF); |
| 490 | #endif |
| 491 | lua_newtable(L); |
| 492 | |
| 493 | lua_pushcfunction(L, uint64_tostring); |
| 494 | lua_setfield(L, -2, "tostring"); |
| 495 | |
| 496 | lua_pushcfunction(L, uint64_compare); |
| 497 | lua_setfield(L, -2, "compare"); |
| 498 | |
| 499 | lua_pushcfunction(L, uint64_divide); |
| 500 | lua_setfield(L, -2, "divide"); |
| 501 | |
| 502 | lua_pushcfunction(L, uint64_remainder); |
| 503 | lua_setfield(L, -2, "remainder"); |
| 504 | |
| 505 | lua_pushcfunction(L, uint64_parse); |
| 506 | lua_setfield(L, -2, "parse"); |
| 507 | |
| 508 | lua_setglobal(L, "uint64"); |
nothing calls this directly
no test coverage detected