MINOR: lua: remove some #define
The #define compilation directives are centralized in the hlua
include files. This permits to remove ome #ifdef from the haproxy
main code.
diff --git a/include/types/hlua.h b/include/types/hlua.h
index d0e0348..2257d5c 100644
--- a/include/types/hlua.h
+++ b/include/types/hlua.h
@@ -1,6 +1,8 @@
#ifndef _TYPES_HLUA_H
#define _TYPES_HLUA_H
+#ifdef USE_LUA
+
#include <lua.h>
#include <lauxlib.h>
@@ -121,4 +123,12 @@
struct channel *chn;
};
+#else /* USE_LUA */
+
+/* Empty struct for compilation compatibility */
+struct hlua { };
+struct hlua_socket { };
+
+#endif /* USE_LUA */
+
#endif /* _TYPES_HLUA_H */
diff --git a/include/types/session.h b/include/types/session.h
index ad31ae2..8aa20bd 100644
--- a/include/types/session.h
+++ b/include/types/session.h
@@ -33,10 +33,7 @@
#include <types/channel.h>
#include <types/compression.h>
-
-#ifdef USE_LUA
#include <types/hlua.h>
-#endif
#include <types/obj_type.h>
#include <types/proto_http.h>
#include <types/proxy.h>
@@ -164,9 +161,7 @@
struct list *current_rule_list; /* this is used to store the current executed rule list. */
struct list *current_rule; /* this is used to store the current rule to be resumed. */
-#ifdef USE_LUA
struct hlua hlua; /* lua runtime context */
-#endif
};
#endif /* _TYPES_SESSION_H */
diff --git a/include/types/stream_interface.h b/include/types/stream_interface.h
index ab0e750..03cdd6e 100644
--- a/include/types/stream_interface.h
+++ b/include/types/stream_interface.h
@@ -27,9 +27,7 @@
#include <types/channel.h>
#include <types/connection.h>
-#ifdef USE_LUA
#include <types/hlua.h>
-#endif
#include <types/obj_type.h>
#include <common/config.h>
@@ -153,14 +151,12 @@
struct pattern_expr *expr;
struct chunk chunk;
} map;
-#ifdef USE_LUA
struct {
int connected;
struct hlua_socket *socket;
struct list wake_on_read;
struct list wake_on_write;
} hlua;
-#endif
} ctx; /* used by stats I/O handlers to dump the stats */
};