From dc0306e3e4f823db7e7bd2d6d031041b58a35fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyril=20Bont=C3=A9?= Date: Mon, 2 Mar 2015 00:08:40 +0100 Subject: [PATCH] MINOR: lua: add a compilation error message when compiled with an incompatible version haproxy Lua support begins with Lua 5.2. In order to ease the diagnostic on compilation error, a preprocessor error is added when an incompatible version is used. The compatibility is determined by the presence of LUA_VERSION_NUM and its magic value (502 for Lua 5.2.x). --- src/hlua.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hlua.c b/src/hlua.c index 9ded473c1..51e149e71 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -4,6 +4,10 @@ #include #include +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +#error "Requires Lua 5.2 or later." +#endif + #include #include