# Some hack for libevent 2.0
CHECK_C_SOURCE_COMPILES ("#include <event.h>
- #if _EVENT_NUMERIC_VERSION < 0x02000000
+ #if !defined(LIBEVENT_VERSION_NUMBER) || LIBEVENT_VERSION_NUMBER < 0x02000000
#error Unsupported
#endif
int main() { return 0;}" HAVE_LIBEVENT2)
+CHECK_C_SOURCE_COMPILES ("#include <event2/event.h>
+ int main() { return EVENT_BASE_FLAG_NO_CACHE_TIME; }"
+ HAVE_EVENT_NO_CACHE_TIME_FLAG)
+LIST(APPEND CMAKE_REQUIRED_LIBRARIES "event")
+CHECK_SYMBOL_EXISTS(event_base_update_cache_time "sys/types.h;event.h"
+ HAVE_EVENT_NO_CACHE_TIME_FUNC)
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS")
IF(HAVE_CLOCK_GETTIME)
#cmakedefine HAVE_IPV6_V6ONLY 1
#cmakedefine HAVE_LIBAIO_H 1
#cmakedefine HAVE_LIBEVENT2 1
+#cmakedefine HAVE_EVENT_NO_CACHE_TIME_FLAG 1
+#cmakedefine HAVE_EVENT_NO_CACHE_TIME_FUNC 1
#cmakedefine HAVE_LIBGEN_H 1
#cmakedefine HAVE_LIBUTIL_H 1
#cmakedefine HAVE_LOCALE_H 1
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
+
#include <event.h>
#include <time.h>
lua_pop (L, 1);
lua_pushstring (L, "timeout");
- lua_gettable (L, -2);
+ lua_gettable (L, 1);
if (lua_type (L, -1) == LUA_TNUMBER) {
timeout = lua_tonumber (L, -1);
}
lua_pushstring (L, "args");
- lua_gettable (L, -2);
+ lua_gettable (L, 1);
lua_redis_parse_args (L, -1, cmd, &sp_ud->args, &sp_ud->arglens,
&sp_ud->nargs);
lua_pop (L, 1);