webmcp
changeset 66:afed1ab1477f
Bugfix regarding compatibility with Lua 5.2:
#if instead of #ifdef in webmcp_accelerator.c
#if instead of #ifdef in webmcp_accelerator.c
author | jbe |
---|---|
date | Tue Apr 17 15:38:05 2012 +0200 (2012-04-17) |
parents | a54cc7dcabf1 |
children | 937bbe05098c |
files | Makefile.options framework/accelerator/webmcp_accelerator.c |
line diff
1.1 --- a/Makefile.options Tue Apr 17 15:20:42 2012 +0200 1.2 +++ b/Makefile.options Tue Apr 17 15:38:05 2012 +0200 1.3 @@ -10,13 +10,13 @@ 1.4 # C compiler flags 1.5 # TODO: check alternatives to -D_GNU_SOURCE -fPIC 1.6 # using libtool? 1.7 -CFLAGS = -O2 -D_GNU_SOURCE -fPIC -Wall -I /usr/include -I /usr/local/include -I /usr/local/include/lua51 -I /usr/include/lua5.1 1.8 +CFLAGS = -O2 -D_GNU_SOURCE -fPIC -Wall -I /usr/include -I /usr/local/include -I /home/flocke/opt/lua52/include 1.9 1.10 # additional C compiler flags for parts which depend on PostgreSQL 1.11 CFLAGS_PGSQL = -I /usr/include/postgresql -I /usr/include/postgresql/server -I /usr/local/include/postgresql -I /usr/local/include/postgresql/server 1.12 1.13 # linker flags 1.14 -LDFLAGS = -shared -L /usr/lib -L /usr/local/lib -L /usr/local/lib/lua51 -L /usr/lib/lua5.1 1.15 +LDFLAGS = -shared -L /usr/lib -L /usr/local/lib -L /home/flocke/opt/lua52/lib 1.16 1.17 # additional linker flags for parts which depend on PostgreSQL 1.18 LDFLAGS_PGSQL =
2.1 --- a/framework/accelerator/webmcp_accelerator.c Tue Apr 17 15:20:42 2012 +0200 2.2 +++ b/framework/accelerator/webmcp_accelerator.c Tue Apr 17 15:38:05 2012 +0200 2.3 @@ -53,7 +53,7 @@ 2.4 lua_pushvalue(L, 1); 2.5 lua_gettable(L, -2); // get table by reference passed as 1st argument 2.6 lua_getfield(L, -1, "string_fragments"); 2.7 -#ifdef LUA_VERSION_NUM >= 502 2.8 +#if LUA_VERSION_NUM >= 502 2.9 j = lua_rawlen(L, -1); 2.10 #else 2.11 j = lua_objlen(L, -1); 2.12 @@ -75,7 +75,7 @@ 2.13 lua_getfield(L, -2, "_active_slot"); 2.14 lua_gettable(L, -2); 2.15 lua_getfield(L, -1, "string_fragments"); 2.16 -#ifdef LUA_VERSION_NUM >= 502 2.17 +#if LUA_VERSION_NUM >= 502 2.18 j = lua_rawlen(L, -1); 2.19 #else 2.20 j = lua_objlen(L, -1); 2.21 @@ -116,7 +116,7 @@ 2.22 tag_given = 1; 2.23 } 2.24 } 2.25 -#ifdef LUA_VERSION_NUM >= 502 2.26 +#if LUA_VERSION_NUM >= 502 2.27 j = lua_rawlen(L, 5); 2.28 #else 2.29 j = lua_objlen(L, 5); 2.30 @@ -165,7 +165,7 @@ 2.31 lua_call(L, 0, 0); 2.32 // stack is now at position 7, but we don't care 2.33 // we assume that the active slot hasn't been exchanged or resetted 2.34 -#ifdef LUA_VERSION_NUM >= 502 2.35 +#if LUA_VERSION_NUM >= 502 2.36 j = lua_rawlen(L, 5); // but it may include more elements now 2.37 #else 2.38 j = lua_objlen(L, 5); // but it may include more elements now