# HG changeset patch # User jbe # Date 1334669885 -7200 # Node ID afed1ab1477fef33b7ea0d1bf50ef83d466b3717 # Parent a54cc7dcabf15e35bc6bc63a03971b880aece3e2 Bugfix regarding compatibility with Lua 5.2: #if instead of #ifdef in webmcp_accelerator.c diff -r a54cc7dcabf1 -r afed1ab1477f Makefile.options --- a/Makefile.options Tue Apr 17 15:20:42 2012 +0200 +++ b/Makefile.options Tue Apr 17 15:38:05 2012 +0200 @@ -10,13 +10,13 @@ # C compiler flags # TODO: check alternatives to -D_GNU_SOURCE -fPIC # using libtool? -CFLAGS = -O2 -D_GNU_SOURCE -fPIC -Wall -I /usr/include -I /usr/local/include -I /usr/local/include/lua51 -I /usr/include/lua5.1 +CFLAGS = -O2 -D_GNU_SOURCE -fPIC -Wall -I /usr/include -I /usr/local/include -I /home/flocke/opt/lua52/include # additional C compiler flags for parts which depend on PostgreSQL CFLAGS_PGSQL = -I /usr/include/postgresql -I /usr/include/postgresql/server -I /usr/local/include/postgresql -I /usr/local/include/postgresql/server # linker flags -LDFLAGS = -shared -L /usr/lib -L /usr/local/lib -L /usr/local/lib/lua51 -L /usr/lib/lua5.1 +LDFLAGS = -shared -L /usr/lib -L /usr/local/lib -L /home/flocke/opt/lua52/lib # additional linker flags for parts which depend on PostgreSQL LDFLAGS_PGSQL = diff -r a54cc7dcabf1 -r afed1ab1477f framework/accelerator/webmcp_accelerator.c --- a/framework/accelerator/webmcp_accelerator.c Tue Apr 17 15:20:42 2012 +0200 +++ b/framework/accelerator/webmcp_accelerator.c Tue Apr 17 15:38:05 2012 +0200 @@ -53,7 +53,7 @@ lua_pushvalue(L, 1); lua_gettable(L, -2); // get table by reference passed as 1st argument lua_getfield(L, -1, "string_fragments"); -#ifdef LUA_VERSION_NUM >= 502 +#if LUA_VERSION_NUM >= 502 j = lua_rawlen(L, -1); #else j = lua_objlen(L, -1); @@ -75,7 +75,7 @@ lua_getfield(L, -2, "_active_slot"); lua_gettable(L, -2); lua_getfield(L, -1, "string_fragments"); -#ifdef LUA_VERSION_NUM >= 502 +#if LUA_VERSION_NUM >= 502 j = lua_rawlen(L, -1); #else j = lua_objlen(L, -1); @@ -116,7 +116,7 @@ tag_given = 1; } } -#ifdef LUA_VERSION_NUM >= 502 +#if LUA_VERSION_NUM >= 502 j = lua_rawlen(L, 5); #else j = lua_objlen(L, 5); @@ -165,7 +165,7 @@ lua_call(L, 0, 0); // stack is now at position 7, but we don't care // we assume that the active slot hasn't been exchanged or resetted -#ifdef LUA_VERSION_NUM >= 502 +#if LUA_VERSION_NUM >= 502 j = lua_rawlen(L, 5); // but it may include more elements now #else j = lua_objlen(L, 5); // but it may include more elements now