# HG changeset patch # User Myhailo Danylenko # Date 1263689924 -7200 # Node ID afcdbbce5002aef2d864df2bcb6b4d963a7662b1 # Parent 21547232c875cccfec27283d7ccc5915368b46b0 Autodetect if unregister_reply_handler is present diff -r 21547232c875 -r afcdbbce5002 CMakeLists.txt --- a/CMakeLists.txt Sun Jan 17 02:16:30 2010 +0200 +++ b/CMakeLists.txt Sun Jan 17 02:58:44 2010 +0200 @@ -69,6 +69,7 @@ set(CMAKE_REQUIRED_INCLUDES ${LM_INCLUDE_DIRS}) set(CMAKE_REQUIRED_LIBRARIES ${LM_LIBRARIES}) check_function_exists(lm_connection_get_keep_alive_rate HAVE_LM_CONNECTION_GET_KEEP_ALIVE_RATE) +check_function_exists(lm_connection_unregister_reply_handler HAVE_LM_CONNECTION_UNREGISTER_REPLY_HANDLER) find_package(Perl) ## Set up compiler diff -r 21547232c875 -r afcdbbce5002 config.h.in --- a/config.h.in Sun Jan 17 02:16:30 2010 +0200 +++ b/config.h.in Sun Jan 17 02:58:44 2010 +0200 @@ -25,6 +25,9 @@ // define this, if your loudmouth have lm_connection_get_keep_alive_rate () #cmakedefine HAVE_LM_CONNECTION_GET_KEEP_ALIVE_RATE +// define this, if your loudmouth have lm_connection_unregister_reply_handler () +#cmakedefine HAVE_LM_CONNECTION_UNREGISTER_REPLY_HANDLER + #ifdef DEBUG # include diff -r 21547232c875 -r afcdbbce5002 lm_connection.c --- a/lm_connection.c Sun Jan 17 02:16:30 2010 +0200 +++ b/lm_connection.c Sun Jan 17 02:58:44 2010 +0200 @@ -429,13 +429,14 @@ } lua_pop (L, 1); } else { // Unregister reply handler -#if 0 +#ifdef HAVE_LM_CONNECTION_UNREGISTER_REPLY_HANDLER llm_handler_t *handler = luaL_checklm_handler (L, 2); lm_connection_unregister_reply_handler (object -> connection, handler -> handler); #else + W ("Sorry, your loudmouth have no unregister_reply_handler ()"); lua_pushnil (L); - lua_pushliteral (L, "Sorry, lm_connection_unregister_reply_handler is not yet supported"); + lua_pushliteral (L, "Sorry, your loudmouth have no unregister_reply_handler ()"); return 2; #endif }