1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-12-22 04:02:04 +03:00

Support build for Lua 5.1 (for LuaJIT), Lua 5.2 and Lua 5.3 (Step 2/?)

See #195
This commit is contained in:
bel
2015-08-22 21:43:38 +02:00
parent 2c614b584c
commit b06ded3056
6 changed files with 68 additions and 38 deletions

View File

@@ -1,29 +1,7 @@
#include <lua.h>
#include <lauxlib.h>
#include "civetweb_lua.h"
#include "lua_civet.h"
#ifndef LUA_VERSION_NUM
#error "Unknown Lua version"
#elif LUA_VERSION_NUM == 501
/* Lua 5.1 detected */
#define LUA_OK 0
#define LUA_ERRGCMM 999 /* not supported */
#define mg_lua_load(a,b,c,d,e) lua_load(a,b,c,d)
#define lua_rawlen lua_objlen
#define lua_newstate(a, b) luaL_newstate() /* Must use luaL_newstate() for 64 bit target */
#elif LUA_VERSION_NUM == 502
/* Lua 5.2 detected */
#define mg_lua_load lua_load
#elif LUA_VERSION_NUM == 503
/* Lua 5.3 detected */
#define mg_lua_load lua_load
#endif
#ifdef _WIN32
static void *
mmap(void *addr, int64_t len, int prot, int flags, int fd, int offset)