From 380b7e8b7ba6acfdc5513da08c4bcc7278b72445 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Sun, 26 Apr 2009 02:08:18 +0000 Subject: [PATCH] Allow CPP linkage by adding extern "C" {} to external header files. git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2148 fd59a12c-fef9-0310-b244-a6a79926bd2f --- include/corosync/confdb.h | 8 ++++++++ include/corosync/coroipcc.h | 9 +++++++++ include/corosync/coroipcs.h | 8 ++++++++ include/corosync/cpg.h | 8 ++++++++ include/corosync/engine/logsys.h | 8 ++++++++ include/corosync/evs.h | 8 ++++++++ include/corosync/lcr/lcr_ifact.h | 9 +++++++++ include/corosync/pload.h | 9 +++++++++ include/corosync/quorum.h | 8 ++++++++ include/corosync/totem/coropoll.h | 9 ++++++--- include/corosync/totem/totemip.h | 8 ++++++++ include/corosync/totem/totempg.h | 8 ++++++++ include/corosync/votequorum.h | 8 +++++++- 13 files changed, 104 insertions(+), 4 deletions(-) diff --git a/include/corosync/confdb.h b/include/corosync/confdb.h index 8693048d..e0797bb3 100644 --- a/include/corosync/confdb.h +++ b/include/corosync/confdb.h @@ -37,6 +37,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @addtogroup confdb_corosync * @@ -283,4 +287,8 @@ cs_error_t confdb_context_set ( confdb_handle_t handle, const void *context); +#ifdef __cplusplus +} +#endif + #endif /* COROSYNC_CONFDB_H_DEFINED */ diff --git a/include/corosync/coroipcc.h b/include/corosync/coroipcc.h index 195f4899..4fa42cd5 100644 --- a/include/corosync/coroipcc.h +++ b/include/corosync/coroipcc.h @@ -41,6 +41,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + extern cs_error_t coroipcc_service_connect ( const char *socket_name, @@ -106,4 +110,9 @@ coroipcc_zcb_msg_send_reply_receive ( void *res_msg, size_t res_len); + +#ifdef __cplusplus +} +#endif + #endif /* COROIPCC_H_DEFINED */ diff --git a/include/corosync/coroipcs.h b/include/corosync/coroipcs.h index a7e648eb..e3f5cef2 100644 --- a/include/corosync/coroipcs.h +++ b/include/corosync/coroipcs.h @@ -37,6 +37,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + struct iovec; typedef int (*coroipcs_init_fn_lvalue) (void *conn); @@ -110,4 +114,8 @@ extern int coroipcs_handler_dispatch ( int revent, void *context); +#ifdef __cplusplus +} +#endif + #endif /* COROIPCS_H_DEFINED */ diff --git a/include/corosync/cpg.h b/include/corosync/cpg.h index 9130dbb2..30e4b791 100644 --- a/include/corosync/cpg.h +++ b/include/corosync/cpg.h @@ -37,6 +37,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @addtogroup cpg_corosync * @@ -201,4 +205,8 @@ cs_error_t cpg_zcb_mcast_joined ( void *msg, size_t msg_len); +#ifdef __cplusplus +} +#endif + #endif /* COROSYNC_CPG_H_DEFINED */ diff --git a/include/corosync/engine/logsys.h b/include/corosync/engine/logsys.h index dc84f1b8..90919f2e 100644 --- a/include/corosync/engine/logsys.h +++ b/include/corosync/engine/logsys.h @@ -42,6 +42,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* * All of the LOGSYS_MODE's can be ORed together for combined behavior * @@ -370,4 +374,8 @@ do { \ __FILE__, __LINE__, LOGSYS_TAG_TRACE8, format, ##args);\ } while(0) +#ifdef __cplusplus +} +#endif + #endif /* LOGSYS_H_DEFINED */ diff --git a/include/corosync/evs.h b/include/corosync/evs.h index 31113efc..a19004be 100644 --- a/include/corosync/evs.h +++ b/include/corosync/evs.h @@ -37,6 +37,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @defgroup corosync Other API services provided by corosync */ @@ -165,4 +169,8 @@ cs_error_t evs_membership_get ( unsigned int *member_list, size_t *member_list_entries); +#ifdef __cplusplus +} +#endif + #endif /* COROSYNC_EVS_H_DEFINED */ diff --git a/include/corosync/lcr/lcr_ifact.h b/include/corosync/lcr/lcr_ifact.h index 4ae59c6e..0be3e370 100644 --- a/include/corosync/lcr/lcr_ifact.h +++ b/include/corosync/lcr/lcr_ifact.h @@ -33,6 +33,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + int lcr_ifact_reference ( hdb_handle_t *handle, const char *iface_name, @@ -43,4 +47,9 @@ int lcr_ifact_reference ( int lcr_ifact_release ( hdb_handle_t handle); + +#ifdef __cplusplus +} +#endif + #endif /* LCR_IFACT_H_DEFINED */ diff --git a/include/corosync/pload.h b/include/corosync/pload.h index 3e34b54a..ff9bcecc 100644 --- a/include/corosync/pload.h +++ b/include/corosync/pload.h @@ -37,6 +37,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @defgroup corosync Other API services provided by corosync */ @@ -97,4 +101,9 @@ unsigned int pload_start ( unsigned int msg_count, unsigned int msg_size); + +#ifdef __cplusplus +} +#endif + #endif /* COROSYNC_PLOAD_H_DEFINED */ diff --git a/include/corosync/quorum.h b/include/corosync/quorum.h index 39690c19..ab5333b7 100644 --- a/include/corosync/quorum.h +++ b/include/corosync/quorum.h @@ -36,6 +36,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef uint64_t quorum_handle_t; typedef struct { @@ -109,4 +113,8 @@ cs_error_t quorum_context_get ( quorum_handle_t handle, const void **context); +#ifdef __cplusplus +} +#endif + #endif /* COROSYNC_QUORUM_H_DEFINED */ diff --git a/include/corosync/totem/coropoll.h b/include/corosync/totem/coropoll.h index c095e404..16e1b8a4 100644 --- a/include/corosync/totem/coropoll.h +++ b/include/corosync/totem/coropoll.h @@ -37,6 +37,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + typedef void * poll_timer_handle; hdb_handle_t poll_create (void); @@ -85,9 +89,8 @@ int poll_run ( int poll_stop ( hdb_handle_t handle); -#ifdef COMPILE_OUT -void poll_print_state ( - hdb_handle_t handle, int fd); +#ifdef __cplusplus +} #endif #endif /* POLL_H_DEFINED */ diff --git a/include/corosync/totem/totemip.h b/include/corosync/totem/totemip.h index efc8e835..9f45b5f9 100644 --- a/include/corosync/totem/totemip.h +++ b/include/corosync/totem/totemip.h @@ -40,6 +40,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #ifdef SO_NOSIGPIPE #ifndef MSG_NOSIGNAL #define MSG_NOSIGNAL 0 @@ -93,4 +97,8 @@ static inline int totemip_zero_check(const struct totem_ip_address *addr) return (addr->family == 0); } +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/corosync/totem/totempg.h b/include/corosync/totem/totempg.h index d693b84c..a5a2a2bc 100644 --- a/include/corosync/totem/totempg.h +++ b/include/corosync/totem/totempg.h @@ -36,6 +36,10 @@ #ifndef TOTEMPG_H_DEFINED #define TOTEMPG_H_DEFINED +#ifdef __cplusplus +extern "C" { +#endif + #include #include "totem.h" #include "coropoll.h" @@ -149,4 +153,8 @@ extern int totempg_crypto_set (unsigned int type); extern int totempg_ring_reenable (void); +#ifdef __cplusplus +} +#endif + #endif /* TOTEMPG_H_DEFINED */ diff --git a/include/corosync/votequorum.h b/include/corosync/votequorum.h index bc058087..31b60c56 100644 --- a/include/corosync/votequorum.h +++ b/include/corosync/votequorum.h @@ -35,8 +35,11 @@ #ifndef COROSYNC_VOTEQUORUM_H_DEFINED #define COROSYNC_VOTEQUORUM_H_DEFINED -typedef uint64_t votequorum_handle_t; +#ifdef __cplusplus +extern "C" { +#endif +typedef uint64_t votequorum_handle_t; #define VOTEQUORUM_MAX_QDISK_NAME_LEN 255 @@ -209,4 +212,7 @@ cs_error_t votequorum_context_set ( votequorum_handle_t handle, void *context); +#ifdef __cplusplus +} +#endif #endif /* COROSYNC_VOTEQUORUM_H_DEFINED */ -- 2.39.5