From: Josef 'Jeff' Sipek Date: Thu, 11 Mar 2021 18:13:03 +0000 (-0500) Subject: Global: Remove support for Lua 5.2 X-Git-Tag: 2.3.15~225 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=508a7f756609541e4eca6d30616db2f28ce2f7aa;p=thirdparty%2Fdovecot%2Fcore.git Global: Remove support for Lua 5.2 It took far too much effort to keep compatible with it. Since every distro out there provides either Lua 5.1 or 5.3, it makes sense to give up on 5.2. --- diff --git a/m4/want_lua.m4 b/m4/want_lua.m4 index 4415500d00..9179d4ae7d 100644 --- a/m4/want_lua.m4 +++ b/m4/want_lua.m4 @@ -16,8 +16,8 @@ AC_DEFUN([DOVECOT_WANT_LUA],[ AS_IF([test -n "$LUA_CFLAGS" -o -n "$LUA_LIBS"], [ with_lua=yes ], [ - for LUAPC in lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua; do - PKG_CHECK_MODULES([LUA], $LUAPC >= 5.1 , [ + for LUAPC in lua5.3 lua-5.3 lua53 lua5.1 lua-5.1 lua51 lua; do + PKG_CHECK_MODULES([LUA], [$LUAPC >= 5.1 $LUAPC != 5.2] , [ with_lua=yes ], [LUAPC=""]) # otherwise pkg_check will fail if test "x$LUA_LIBS" != "x"; then break; fi diff --git a/src/lib-lua/test-lua.c b/src/lib-lua/test-lua.c index 76b7855148..375a53c982 100644 --- a/src/lib-lua/test-lua.c +++ b/src/lib-lua/test-lua.c @@ -214,11 +214,7 @@ static void test_lua(void) check_table_get_luainteger_ok(script, -1, -5, "small-negative-int", 0); check_table_get_luainteger_ok(script, -1, 1ll<<48, "large-positive-int", 1); check_table_get_luainteger_ok(script, -1, -(1ll<<48), "large-negative-int", 2); -#if LUA_VERSION_NUM != 502 check_table_get_luainteger_err(script, -1, -1, "small-float", 3); -#else - check_table_get_uintmax_ok(script, -1, 1, "small-float", 3); -#endif check_table_get_luainteger_err(script, -1, -1, "bool-true", 4); check_table_get_luainteger_err(script, -1, -1, "bool-false", 5); check_table_get_luainteger_err(script, -1, -1, "str", 6); @@ -229,11 +225,7 @@ static void test_lua(void) check_table_get_int_ok(script, -1, -5, "small-negative-int", 0); check_table_get_int_err(script, -1, -1, "large-positive-int", 1); check_table_get_int_err(script, -1, -1, "large-negative-int", 2); -#if LUA_VERSION_NUM != 502 check_table_get_int_err(script, -1, -1, "small-float", 3); -#else - check_table_get_uintmax_ok(script, -1, 1, "small-float", 3); -#endif check_table_get_int_err(script, -1, -1, "bool-true", 4); check_table_get_int_err(script, -1, -1, "bool-false", 5); check_table_get_int_err(script, -1, -1, "str", 6); @@ -244,11 +236,7 @@ static void test_lua(void) check_table_get_intmax_ok(script, -1, -5, "small-negative-int", 0); check_table_get_intmax_ok(script, -1, 1ll<<48, "large-positive-int", 1); check_table_get_intmax_ok(script, -1, -(1ll<<48), "large-negative-int", 2); -#if LUA_VERSION_NUM != 502 check_table_get_intmax_err(script, -1, -1, "small-float", 3); -#else - check_table_get_uintmax_ok(script, -1, 1, "small-float", 3); -#endif check_table_get_intmax_err(script, -1, -1, "bool-true", 4); check_table_get_intmax_err(script, -1, -1, "bool-false", 5); check_table_get_intmax_err(script, -1, -1, "str", 6); @@ -259,11 +247,7 @@ static void test_lua(void) check_table_get_uint_err(script, -1, -1, "small-negative-int", 0); check_table_get_uint_err(script, -1, -1, "large-positive-int", 1); check_table_get_uint_err(script, -1, -1, "large-negative-int", 2); -#if LUA_VERSION_NUM != 502 check_table_get_uint_err(script, -1, -1, "small-float", 3); -#else - check_table_get_uintmax_ok(script, -1, 1, "small-float", 3); -#endif check_table_get_uint_err(script, -1, -1, "bool-true", 4); check_table_get_uint_err(script, -1, -1, "bool-false", 5); check_table_get_uint_err(script, -1, -1, "str", 6); @@ -274,11 +258,7 @@ static void test_lua(void) check_table_get_uintmax_err(script, -1, -1, "small-negative-int", 0); check_table_get_uintmax_ok(script, -1, 1ll<<48, "large-positive-int", 1); check_table_get_uintmax_err(script, -1, -1, "large-negative-int", 2); -#if LUA_VERSION_NUM != 502 check_table_get_uintmax_err(script, -1, -1, "small-float", 3); -#else - check_table_get_uintmax_ok(script, -1, 1, "small-float", 3); -#endif check_table_get_uintmax_err(script, -1, -1, "bool-true", 4); check_table_get_uintmax_err(script, -1, -1, "bool-false", 5); check_table_get_uintmax_err(script, -1, -1, "str", 6); @@ -361,20 +341,8 @@ static void test_compat_tointegerx_and_isinteger(void) { "0xabcdef", 0xabcdef, 1 }, { "0xabcdefg", 0, 0 }, { "abc", 0, 0 }, - - /* - * The following tests fail with Lua 5.2, but work on 5.1 & - * 5.3. (See lua_tointegerx() comment in dlua-compat.h.) - * - * We just hack around it and provide a different set of - * expected test results for 5.2. - */ -#if LUA_VERSION_NUM != 502 { "1.525", 0, 0 }, { "52.51", 0, 0 }, -#else - { "52.51", 52, 1 }, -#endif }; static const struct { lua_Number input; @@ -386,24 +354,11 @@ static void test_compat_tointegerx_and_isinteger(void) { 1, 1, 1 }, { INT_MIN, INT_MIN, 1 }, { INT_MAX, INT_MAX, 1 }, - - /* - * The following tests fail with Lua 5.2, but work on 5.1 & - * 5.3. (See lua_tointegerx() comment in dlua-compat.h.) - * - * We just hack around it and provide a different set of - * expected test results for 5.2. - */ -#if LUA_VERSION_NUM != 502 { 1.525, 0, 0 }, { 52.51, 0, 0 }, { NAN, 0, 0 }, { +INFINITY, 0, 0}, { -INFINITY, 0, 0}, -#else - { 1.525, 1, 1 }, - { 52.51, 52, 1 }, -#endif }; static const struct { lua_Integer input;