]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: lua: add a compilation error message when compiled with an incompatible version
authorCyril Bonté <cyril.bonte@free.fr>
Sun, 1 Mar 2015 23:08:40 +0000 (00:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 2 Mar 2015 12:41:09 +0000 (13:41 +0100)
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

index 9ded473c1c2b05a3cc43c767026ff29a3aace5eb..51e149e71087aea56cb283360dea959c6e930bfd 100644 (file)
@@ -4,6 +4,10 @@
 #include <lua.h>
 #include <lualib.h>
 
+#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
+#error "Requires Lua 5.2 or later."
+#endif
+
 #include <ebpttree.h>
 
 #include <common/cfgparse.h>