[asterisk-commits] russell: trunk r364444 - in /trunk: ./ include/asterisk/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 27 20:21:02 CDT 2012


Author: russell
Date: Fri Apr 27 20:20:57 2012
New Revision: 364444

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=364444
Log:
res_corosync: Fix build against corosync 2.0.

Modified:
    trunk/configure
    trunk/configure.ac
    trunk/include/asterisk/autoconfig.h.in
    trunk/res/res_corosync.c

Modified: trunk/configure.ac
URL: http://svnview.digium.com/svn/asterisk/trunk/configure.ac?view=diff&rev=364444&r1=364443&r2=364444
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Fri Apr 27 20:20:57 2012
@@ -383,6 +383,7 @@
 AST_EXT_LIB_SETUP([BLUETOOTH], [Bluetooth], [bluetooth])
 AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
 AST_EXT_LIB_SETUP([COROSYNC], [Corosync], [cpg])
+AST_EXT_LIB_SETUP_OPTIONAL([COROSYNC_CFG_STATE_TRACK], [A callback only in corosync 1.x], [COROSYNC], [cfg])
 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
 AST_EXT_LIB_SETUP([CRYPTO], [OpenSSL Cryptography], [crypto])
 AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
@@ -2000,6 +2001,7 @@
 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
 
 AST_EXT_LIB_CHECK([COROSYNC], [cpg], [cpg_join], [corosync/cpg.h], [-lcfg])
+AST_EXT_LIB_CHECK([COROSYNC_CFG_STATE_TRACK], [cfg], [corosync_cfg_state_track], [corosync/cfg.h], [-lcfg])
 
 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
 

Modified: trunk/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/autoconfig.h.in?view=diff&rev=364444&r1=364443&r2=364444
==============================================================================
--- trunk/include/asterisk/autoconfig.h.in (original)
+++ trunk/include/asterisk/autoconfig.h.in Fri Apr 27 20:20:57 2012
@@ -139,6 +139,9 @@
 
 /* Define to 1 if you have the Corosync library. */
 #undef HAVE_COROSYNC
+
+/* Define to 1 if COROSYNC has the A callback only in corosync 1.x feature. */
+#undef HAVE_COROSYNC_CFG_STATE_TRACK
 
 /* Define to 1 if you have the `cos' function. */
 #undef HAVE_COS

Modified: trunk/res/res_corosync.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_corosync.c?view=diff&rev=364444&r1=364443&r2=364444
==============================================================================
--- trunk/res/res_corosync.c (original)
+++ trunk/res/res_corosync.c Fri Apr 27 20:20:57 2012
@@ -68,15 +68,19 @@
 static cpg_handle_t cpg_handle;
 static corosync_cfg_handle_t cfg_handle;
 
+#ifdef HAVE_COROSYNC_CFG_STATE_TRACK
 static void cfg_state_track_cb(
 		corosync_cfg_state_notification_buffer_t *notification_buffer,
 		cs_error_t error);
+#endif /* HAVE_COROSYNC_CFG_STATE_TRACK */
 
 static void cfg_shutdown_cb(corosync_cfg_handle_t cfg_handle,
 		corosync_cfg_shutdown_flags_t flags);
 
 static corosync_cfg_callbacks_t cfg_callbacks = {
+#ifdef HAVE_COROSYNC_CFG_STATE_TRACK
 	.corosync_cfg_state_track_callback = cfg_state_track_cb,
+#endif /* HAVE_COROSYNC_CFG_STATE_TRACK */
 	.corosync_cfg_shutdown_callback = cfg_shutdown_cb,
 };
 
@@ -95,11 +99,13 @@
 
 static void ast_event_cb(const struct ast_event *event, void *data);
 
+#ifdef HAVE_COROSYNC_CFG_STATE_TRACK
 static void cfg_state_track_cb(
 		corosync_cfg_state_notification_buffer_t *notification_buffer,
 		cs_error_t error)
 {
 }
+#endif /* HAVE_COROSYNC_CFG_STATE_TRACK */
 
 static void cfg_shutdown_cb(corosync_cfg_handle_t cfg_handle,
 		corosync_cfg_shutdown_flags_t flags)




More information about the asterisk-commits mailing list