compat52 for luajit2

This commit is contained in:
云风
2012-09-11 19:54:12 +08:00
parent 481dfb85bb
commit 7e37bc6ee3
10 changed files with 482 additions and 10 deletions

View File

@@ -1,3 +1,4 @@
#include "luacompat52.h"
#include <lua.h>
#include <lauxlib.h>
#include <stdint.h>
@@ -198,7 +199,7 @@ tostring(lua_State *L) {
uintptr_t n = (uintptr_t)lua_touserdata(L,1);
if (lua_gettop(L) == 1) {
luaL_Buffer b;
luaL_buffinitsize(L , &b , 28);
luaL_buffinit(L , &b);
luaL_addstring(&b, "int64: 0x");
int i;
bool strip = true;
@@ -230,7 +231,7 @@ tostring(lua_State *L) {
case 10: {
int64_t dec = (int64_t)n;
luaL_Buffer b;
luaL_buffinitsize(L , &b , 28);
luaL_buffinit(L , &b);
if (dec<0) {
luaL_addchar(&b, '-');
dec = -dec;