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,5 +1,6 @@
#include "skynet_imp.h"
#include "skynet_env.h"
#include "luacompat52.h"
#include <stdio.h>
#include <stdlib.h>
@@ -45,7 +46,7 @@ optstring(const char *key,const char * opt) {
static void
_init_env(lua_State *L) {
lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS);
lua_pushglobaltable(L);
lua_pushnil(L); /* first key */
while (lua_next(L, -2) != 0) {
int keyt = lua_type(L, -2);
@@ -85,6 +86,7 @@ main(int argc, char *argv[]) {
lua_close(L);
L = luaL_newstate();
luaL_init(L);
int err = luaL_dofile(L, config_file);
if (err) {