From eccde9b8f1ef6184626c66989af162b8ff0b8dcc Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Sep 2017 11:54:35 +0200 Subject: [PATCH] feat(c-tools): remove C_NAME of macros --- src/c-wrapper/api/c-address.cpp | 4 +-- src/c-wrapper/api/c-call-params.cpp | 28 +++++++++----------- src/c-wrapper/api/c-chat-room.cpp | 13 ++++----- src/c-wrapper/api/c-event-log.cpp | 26 +++++++++--------- src/c-wrapper/api/c-participant.cpp | 2 +- src/c-wrapper/c-tools.h | 38 +++++++++++++-------------- src/chat/chat-room.cpp | 4 +-- src/chat/client-group-chat-room.cpp | 16 +++++------ src/chat/real-time-text-chat-room.cpp | 4 +-- 9 files changed, 66 insertions(+), 69 deletions(-) diff --git a/src/c-wrapper/api/c-address.cpp b/src/c-wrapper/api/c-address.cpp index 32add40aa..78e166181 100644 --- a/src/c-wrapper/api/c-address.cpp +++ b/src/c-wrapper/api/c-address.cpp @@ -23,7 +23,7 @@ // ============================================================================= -L_DECLARE_C_CLONABLE_STRUCT_IMPL(Address, Address, address); +L_DECLARE_C_CLONABLE_STRUCT_IMPL(Address, Address); using namespace std; @@ -36,7 +36,7 @@ LinphoneAddress *linphone_address_new (const char *address) { return nullptr; } - LinphoneAddress *object = _linphone_address_init(); + LinphoneAddress *object = _linphone_Address_init(); object->cppPtr = cppPtr; return object; } diff --git a/src/c-wrapper/api/c-call-params.cpp b/src/c-wrapper/api/c-call-params.cpp index 3852a7343..5356da94a 100644 --- a/src/c-wrapper/api/c-call-params.cpp +++ b/src/c-wrapper/api/c-call-params.cpp @@ -28,12 +28,10 @@ // ============================================================================= -#define GET_CALL_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj, CallSessionParams, CallParams) -#define GET_CALL_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_STRUCT(obj, CallSessionParams) #define GET_MEDIA_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj, MediaSessionParams) #define GET_MEDIA_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_STRUCT(obj, MediaSessionParams) -L_DECLARE_C_CLONABLE_STRUCT_IMPL(MediaSessionParams, CallParams, call_params) +L_DECLARE_C_CLONABLE_STRUCT_IMPL(MediaSessionParams, CallParams) using namespace std; @@ -85,7 +83,7 @@ SalStreamDir get_video_dir_from_call_params (const LinphoneCallParams *params) { } void linphone_call_params_set_custom_headers (LinphoneCallParams *params, const SalCustomHeader *ch) { - GET_CALL_CPP_PRIVATE_PTR(params)->setCustomHeaders(ch); + GET_MEDIA_CPP_PRIVATE_PTR(params)->setCustomHeaders(ch); } void linphone_call_params_set_custom_sdp_attributes (LinphoneCallParams *params, const SalCustomSdpAttribute *csa) { @@ -381,19 +379,19 @@ void linphone_call_params_set_received_fps (LinphoneCallParams *params, float va // ============================================================================= bool_t linphone_call_params_get_in_conference (const LinphoneCallParams *params) { - return GET_CALL_CPP_PRIVATE_PTR(params)->getInConference(); + return GET_MEDIA_CPP_PRIVATE_PTR(params)->getInConference(); } void linphone_call_params_set_in_conference (LinphoneCallParams *params, bool_t value) { - GET_CALL_CPP_PRIVATE_PTR(params)->setInConference(value); + GET_MEDIA_CPP_PRIVATE_PTR(params)->setInConference(value); } bool_t linphone_call_params_get_internal_call_update (const LinphoneCallParams *params) { - return GET_CALL_CPP_PRIVATE_PTR(params)->getInternalCallUpdate(); + return GET_MEDIA_CPP_PRIVATE_PTR(params)->getInternalCallUpdate(); } void linphone_call_params_set_internal_call_update (LinphoneCallParams *params, bool_t value) { - GET_CALL_CPP_PRIVATE_PTR(params)->setInternalCallUpdate(value); + GET_MEDIA_CPP_PRIVATE_PTR(params)->setInternalCallUpdate(value); } bool_t linphone_call_params_implicit_rtcp_fb_enabled (const LinphoneCallParams *params) { @@ -437,7 +435,7 @@ void linphone_call_params_set_up_ptime (LinphoneCallParams *params, int value) { } SalCustomHeader *linphone_call_params_get_custom_headers (const LinphoneCallParams *params) { - return GET_CALL_CPP_PRIVATE_PTR(params)->getCustomHeaders(); + return GET_MEDIA_CPP_PRIVATE_PTR(params)->getCustomHeaders(); } SalCustomSdpAttribute *linphone_call_params_get_custom_sdp_attributes (const LinphoneCallParams *params) { @@ -449,11 +447,11 @@ SalCustomSdpAttribute *linphone_call_params_get_custom_sdp_media_attributes (con } LinphoneCall *linphone_call_params_get_referer (const LinphoneCallParams *params) { - return GET_CALL_CPP_PRIVATE_PTR(params)->getReferer(); + return GET_MEDIA_CPP_PRIVATE_PTR(params)->getReferer(); } void linphone_call_params_set_referer (LinphoneCallParams *params, LinphoneCall *referer) { - GET_CALL_CPP_PRIVATE_PTR(params)->setReferer(referer); + GET_MEDIA_CPP_PRIVATE_PTR(params)->setReferer(referer); } bool_t linphone_call_params_get_update_call_when_ice_completed (const LinphoneCallParams *params) { @@ -481,11 +479,11 @@ void linphone_call_params_set_received_video_definition (LinphoneCallParams *par } bool_t linphone_call_params_get_no_user_consent (const LinphoneCallParams *params) { - return GET_CALL_CPP_PRIVATE_PTR(params)->getNoUserConsent(); + return GET_MEDIA_CPP_PRIVATE_PTR(params)->getNoUserConsent(); } void linphone_call_params_set_no_user_consent (LinphoneCallParams *params, bool_t value) { - GET_CALL_CPP_PRIVATE_PTR(params)->setNoUserConsent(value); + GET_MEDIA_CPP_PRIVATE_PTR(params)->setNoUserConsent(value); } // ============================================================================= @@ -514,14 +512,14 @@ void linphone_call_params_unref (LinphoneCallParams *cp) { // ============================================================================= LinphoneCallParams *linphone_call_params_new (LinphoneCore *core) { - LinphoneCallParams *params = _linphone_call_params_init(); + LinphoneCallParams *params = _linphone_CallParams_init(); L_SET_CPP_PTR_FROM_C_STRUCT(params, new LinphonePrivate::MediaSessionParams()); GET_MEDIA_CPP_PTR(params)->initDefault(core); return params; } LinphoneCallParams *linphone_call_params_new_for_wrapper (void) { - return _linphone_call_params_init(); + return _linphone_CallParams_init(); } /* DEPRECATED */ diff --git a/src/c-wrapper/api/c-chat-room.cpp b/src/c-wrapper/api/c-chat-room.cpp index 60158d4a6..b62832222 100644 --- a/src/c-wrapper/api/c-chat-room.cpp +++ b/src/c-wrapper/api/c-chat-room.cpp @@ -37,12 +37,13 @@ using namespace std; -extern LinphoneParticipant *_linphone_participant_init (); +extern LinphoneParticipant *_linphone_Participant_init (); static void _linphone_chat_room_constructor (LinphoneChatRoom *cr); static void _linphone_chat_room_destructor (LinphoneChatRoom *cr); -L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(ChatRoom, ChatRoom, chat_room, +L_DECLARE_C_STRUCT_IMPL_WITH_XTORS( + ChatRoom, ChatRoom, _linphone_chat_room_constructor, _linphone_chat_room_destructor, LinphoneChatRoomCbs *cbs; LinphoneAddress *peerAddressCache; @@ -216,7 +217,7 @@ LinphoneChatRoomState linphone_chat_room_get_state (const LinphoneChatRoom *cr) LinphoneParticipant *linphone_chat_room_add_participant (LinphoneChatRoom *cr, const LinphoneAddress *addr) { return L_GET_C_BACK_PTR(GET_CPP_PTR(cr)->addParticipant( *L_GET_CPP_PTR_FROM_C_STRUCT(addr, Address), nullptr, false), - Participant, participant); + Participant); } void linphone_chat_room_add_participants (LinphoneChatRoom *cr, const bctbx_list_t *addresses) { @@ -237,7 +238,7 @@ int linphone_chat_room_get_nb_participants (const LinphoneChatRoom *cr) { } bctbx_list_t *linphone_chat_room_get_participants (const LinphoneChatRoom *cr) { - return L_GET_C_LIST_OF_STRUCT_PTR_FROM_CPP_LIST_OF_CPP_OBJ(GET_CPP_PTR(cr)->getParticipants(), Participant, Participant, participant); + return L_GET_C_LIST_OF_STRUCT_PTR_FROM_CPP_LIST_OF_CPP_OBJ(GET_CPP_PTR(cr)->getParticipants(), Participant, Participant); } void linphone_chat_room_remove_participant (LinphoneChatRoom *cr, LinphoneParticipant *participant) { @@ -274,7 +275,7 @@ void linphone_chat_room_set_user_data (LinphoneChatRoom *cr, void *ud) { // ============================================================================= LinphoneChatRoom *linphone_chat_room_new (LinphoneCore *core, const LinphoneAddress *addr) { - LinphoneChatRoom *cr = _linphone_chat_room_init(); + LinphoneChatRoom *cr = _linphone_ChatRoom_init(); if (linphone_core_realtime_text_enabled(core)) L_SET_CPP_PTR_FROM_C_STRUCT(cr, std::make_shared(core, *L_GET_CPP_PTR_FROM_C_STRUCT(addr, Address))); else @@ -299,7 +300,7 @@ LinphoneChatRoom *linphone_client_group_chat_room_new (LinphoneCore *core, const from = linphone_core_get_primary_contact(core); LinphonePrivate::Address me(from); std::list l = L_GET_CPP_LIST_OF_CPP_OBJ_FROM_C_LIST_OF_STRUCT_PTR(addresses, Address, Address); - LinphoneChatRoom *cr = _linphone_chat_room_init(); + LinphoneChatRoom *cr = _linphone_ChatRoom_init(); L_SET_CPP_PTR_FROM_C_STRUCT(cr, make_shared(core, me, l)); linphone_core_notify_chat_room_instantiated(core, cr); L_GET_PRIVATE_FROM_C_STRUCT(cr, ChatRoom)->setState(LinphonePrivate::ChatRoom::State::Instantiated); diff --git a/src/c-wrapper/api/c-event-log.cpp b/src/c-wrapper/api/c-event-log.cpp index 4d07c6741..d65bce511 100644 --- a/src/c-wrapper/api/c-event-log.cpp +++ b/src/c-wrapper/api/c-event-log.cpp @@ -28,11 +28,11 @@ // ============================================================================= -L_DECLARE_C_CLONABLE_STRUCT_IMPL(EventLog, EventLog, event_log); -L_DECLARE_C_CLONABLE_STRUCT_IMPL(CallEvent, CallEvent, call_event); -L_DECLARE_C_CLONABLE_STRUCT_IMPL(ConferenceEvent, ConferenceEvent, conference_event); -L_DECLARE_C_CLONABLE_STRUCT_IMPL(ConferenceParticipantEvent, ConferenceParticipantEvent, conference_participant_event); -L_DECLARE_C_CLONABLE_STRUCT_IMPL(ChatMessageEvent, ChatMessageEvent, chat_message_event); +L_DECLARE_C_CLONABLE_STRUCT_IMPL(EventLog, EventLog); +L_DECLARE_C_CLONABLE_STRUCT_IMPL(CallEvent, CallEvent); +L_DECLARE_C_CLONABLE_STRUCT_IMPL(ConferenceEvent, ConferenceEvent); +L_DECLARE_C_CLONABLE_STRUCT_IMPL(ConferenceParticipantEvent, ConferenceParticipantEvent); +L_DECLARE_C_CLONABLE_STRUCT_IMPL(ChatMessageEvent, ChatMessageEvent); using namespace std; @@ -41,7 +41,7 @@ using namespace std; // ----------------------------------------------------------------------------- LinphoneEventLog *linphone_event_log_new () { - LinphoneEventLog *event_log = _linphone_event_log_init(); + LinphoneEventLog *event_log = _linphone_EventLog_init(); L_SET_CPP_PTR_FROM_C_STRUCT(event_log, new LINPHONE_NAMESPACE::EventLog()); return event_log; } @@ -62,7 +62,7 @@ LinphoneEventLogType linphone_event_log_get_type (const LinphoneEventLog *event_ // ----------------------------------------------------------------------------- LinphoneCallEvent *linphone_call_event_new (LinphoneEventLogType type, LinphoneCall *call) { - LinphoneCallEvent *call_event = _linphone_call_event_init(); + LinphoneCallEvent *call_event = _linphone_CallEvent_init(); L_SET_CPP_PTR_FROM_C_STRUCT( call_event, new LINPHONE_NAMESPACE::CallEvent( @@ -74,15 +74,14 @@ LinphoneCallEvent *linphone_call_event_new (LinphoneEventLogType type, LinphoneC } // TODO: REMOVE ME. -extern LinphoneCall *_linphone_call_init (); +extern LinphoneCall *_linphone_Call_init (); LinphoneCall *linphone_call_event_get_call (const LinphoneCallEvent *call_event) { return L_GET_C_BACK_PTR( L_GET_CPP_PTR_FROM_C_STRUCT( call_event, CallEvent )->getCall(), - Call, - call + Call ); } @@ -128,7 +127,7 @@ const LinphoneAddress *linphone_conference_participant_event_get_participant_add // ----------------------------------------------------------------------------- LinphoneChatMessageEvent *linphone_chat_message_event_new (LinphoneChatMessage *chat_message) { - LinphoneChatMessageEvent *chat_message_event = _linphone_chat_message_event_init(); + LinphoneChatMessageEvent *chat_message_event = _linphone_ChatMessageEvent_init(); L_SET_CPP_PTR_FROM_C_STRUCT( chat_message_event, new LINPHONE_NAMESPACE::ChatMessageEvent( @@ -139,14 +138,13 @@ LinphoneChatMessageEvent *linphone_chat_message_event_new (LinphoneChatMessage * } // TODO: REMOVE ME. -extern LinphoneChatMessage *_linphone_chat_message_init (); +extern LinphoneChatMessage *_linphone_ChatMessage_init (); LinphoneChatMessage *linphone_chat_message_event_get_chat_message (const LinphoneChatMessageEvent *chat_message_event) { return L_GET_C_BACK_PTR( L_GET_CPP_PTR_FROM_C_STRUCT( chat_message_event, ChatMessageEvent )->getChatMessage(), - ChatMessage, - chat_message + ChatMessage ); } diff --git a/src/c-wrapper/api/c-participant.cpp b/src/c-wrapper/api/c-participant.cpp index cd9956427..ea947d6f9 100644 --- a/src/c-wrapper/api/c-participant.cpp +++ b/src/c-wrapper/api/c-participant.cpp @@ -25,7 +25,7 @@ using namespace std; -L_DECLARE_C_STRUCT_IMPL(Participant, Participant, participant, +L_DECLARE_C_STRUCT_IMPL(Participant, Participant, mutable LinphoneAddress *addressCache; ); diff --git a/src/c-wrapper/c-tools.h b/src/c-wrapper/c-tools.h index 0f11c3c2d..0375ad567 100644 --- a/src/c-wrapper/c-tools.h +++ b/src/c-wrapper/c-tools.h @@ -261,15 +261,15 @@ LINPHONE_END_NAMESPACE #define L_INTERNAL_C_STRUCT_NO_XTOR(OBJECT) -#define L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, C_NAME, CONSTRUCTOR, DESTRUCTOR) \ +#define L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, CONSTRUCTOR, DESTRUCTOR) \ BELLE_SIP_DECLARE_VPTR_NO_EXPORT(Linphone ## C_TYPE); \ - Linphone ## C_TYPE *_linphone_ ## C_NAME ## _init() { \ + Linphone ## C_TYPE *_linphone_ ## C_TYPE ## _init() { \ Linphone ## C_TYPE * object = belle_sip_object_new(Linphone ## C_TYPE); \ new(&object->cppPtr) std::shared_ptr(); \ CONSTRUCTOR(object); \ return object; \ } \ - void _linphone_ ## C_NAME ## _uninit(Linphone ## C_TYPE * object) { \ + static void _linphone_ ## C_TYPE ## _uninit(Linphone ## C_TYPE * object) { \ DESTRUCTOR(object); \ object->cppPtr.~shared_ptr (); \ } \ @@ -277,7 +277,7 @@ LINPHONE_END_NAMESPACE BELLE_SIP_INSTANCIATE_VPTR( \ Linphone ## C_TYPE, \ belle_sip_object_t, \ - _linphone_ ## C_NAME ## _uninit, \ + _linphone_ ## C_TYPE ## _uninit, \ NULL, \ NULL, \ FALSE \ @@ -292,52 +292,52 @@ LINPHONE_END_NAMESPACE // ----------------------------------------------------------------------------- // Declare wrapped C object with constructor/destructor. -#define L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(CPP_CLASS, C_TYPE, C_NAME, CONSTRUCTOR, DESTRUCTOR, ...) \ +#define L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(CPP_CLASS, C_TYPE, CONSTRUCTOR, DESTRUCTOR, ...) \ struct _Linphone ## C_TYPE { \ belle_sip_object_t base; \ std::shared_ptr cppPtr; \ __VA_ARGS__ \ }; \ - L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, C_NAME, CONSTRUCTOR, DESTRUCTOR) + L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, CONSTRUCTOR, DESTRUCTOR) // Declare wrapped C object. -#define L_DECLARE_C_STRUCT_IMPL(CPP_CLASS, C_TYPE, C_NAME, ...) \ +#define L_DECLARE_C_STRUCT_IMPL(CPP_CLASS, C_TYPE, ...) \ struct _Linphone ## C_TYPE { \ belle_sip_object_t base; \ std::shared_ptr cppPtr; \ __VA_ARGS__ \ }; \ - L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, C_NAME, L_INTERNAL_C_STRUCT_NO_XTOR, L_INTERNAL_C_STRUCT_NO_XTOR) + L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, L_INTERNAL_C_STRUCT_NO_XTOR, L_INTERNAL_C_STRUCT_NO_XTOR) // Declare clonable wrapped C object. -#define L_DECLARE_C_CLONABLE_STRUCT_IMPL(CPP_CLASS, C_TYPE, C_NAME, ...) \ +#define L_DECLARE_C_CLONABLE_STRUCT_IMPL(CPP_CLASS, C_TYPE, ...) \ struct _Linphone ## C_TYPE { \ belle_sip_object_t base; \ LINPHONE_NAMESPACE::CPP_CLASS *cppPtr; \ __VA_ARGS__ \ }; \ BELLE_SIP_DECLARE_VPTR_NO_EXPORT(Linphone ## C_TYPE); \ - Linphone ## C_TYPE *_linphone_ ## C_NAME ## _init() { \ + Linphone ## C_TYPE *_linphone_ ## C_TYPE ## _init() { \ return belle_sip_object_new(Linphone ## C_TYPE); \ } \ - void _linphone_ ## C_NAME ## _uninit(Linphone ## C_TYPE * object) { \ + static void _linphone_ ## C_TYPE ## _uninit(Linphone ## C_TYPE * object) { \ delete object->cppPtr; \ } \ - void _linphone_ ## C_NAME ## _clone(Linphone ## C_TYPE * dest, const Linphone ## C_TYPE * src) { \ + static void _linphone_ ## C_TYPE ## _clone(Linphone ## C_TYPE * dest, const Linphone ## C_TYPE * src) { \ L_ASSERT(src->cppPtr); \ dest->cppPtr = new LINPHONE_NAMESPACE::CPP_CLASS(*src->cppPtr); \ } \ BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(Linphone ## C_TYPE); \ BELLE_SIP_INSTANCIATE_VPTR(Linphone ## C_TYPE, belle_sip_object_t, \ - _linphone_ ## C_NAME ## _uninit, \ - _linphone_ ## C_NAME ## _clone, \ + _linphone_ ## C_TYPE ## _uninit, \ + _linphone_ ## C_TYPE ## _clone, \ NULL, \ FALSE \ ); #define L_DECLARE_C_STRUCT_NEW_DEFAULT(C_TYPE, C_NAME) \ Linphone ## C_TYPE * linphone_ ## C_NAME ## _new() { \ - Linphone ## C_TYPE * object = _linphone_ ## C_NAME ## _init(); \ + Linphone ## C_TYPE * object = _linphone_ ## C_TYPE ## _init(); \ object->cppPtr = std::make_shared(); \ return object; \ } @@ -372,9 +372,9 @@ LINPHONE_END_NAMESPACE )) // Get the wrapped C object of a C++ object. -#define L_GET_C_BACK_PTR(OBJECT, C_TYPE, C_NAME) \ +#define L_GET_C_BACK_PTR(OBJECT, C_TYPE) \ LINPHONE_NAMESPACE::Wrapper::getCBackPtr( \ - OBJECT, _linphone_ ## C_NAME ## _init \ + OBJECT, _linphone_ ## C_TYPE ## _init \ ) // Get/set user data on a wrapped C object. @@ -392,8 +392,8 @@ LINPHONE_END_NAMESPACE LINPHONE_NAMESPACE::Wrapper::getCListFromCppList(LIST) #define L_GET_CPP_LIST_FROM_C_LIST(LIST, TYPE) \ LINPHONE_NAMESPACE::Wrapper::getCppListFromCList(LIST) -#define L_GET_C_LIST_OF_STRUCT_PTR_FROM_CPP_LIST_OF_CPP_OBJ(LIST, CPP_TYPE, C_TYPE, C_NAME) \ - LINPHONE_NAMESPACE::Wrapper::getCListOfStructPtrFromCppListOfCppObj(LIST, _linphone_ ## C_NAME ## _init) +#define L_GET_C_LIST_OF_STRUCT_PTR_FROM_CPP_LIST_OF_CPP_OBJ(LIST, CPP_TYPE, C_TYPE) \ + LINPHONE_NAMESPACE::Wrapper::getCListOfStructPtrFromCppListOfCppObj(LIST, _linphone_ ## C_TYPE ## _init) #define L_GET_CPP_LIST_OF_CPP_OBJ_FROM_C_LIST_OF_STRUCT_PTR(LIST, CPP_TYPE, C_TYPE) \ LINPHONE_NAMESPACE::Wrapper::getCppListOfCppObjFromCListOfStructPtr(LIST) diff --git a/src/chat/chat-room.cpp b/src/chat/chat-room.cpp index 37c27da34..348d6c2fe 100644 --- a/src/chat/chat-room.cpp +++ b/src/chat/chat-room.cpp @@ -28,8 +28,8 @@ #include "chat-room.h" -extern LinphoneChatRoom * _linphone_chat_room_init(); -#define GET_BACK_PTR(object) L_GET_C_BACK_PTR(object->shared_from_this(), ChatRoom, chat_room) +extern LinphoneChatRoom * _linphone_ChatRoom_init(); +#define GET_BACK_PTR(object) L_GET_C_BACK_PTR(object->shared_from_this(), ChatRoom) // ============================================================================= diff --git a/src/chat/client-group-chat-room.cpp b/src/chat/client-group-chat-room.cpp index a267eaa57..92ad4dd72 100644 --- a/src/chat/client-group-chat-room.cpp +++ b/src/chat/client-group-chat-room.cpp @@ -23,8 +23,8 @@ // ============================================================================= -extern LinphoneChatRoom * _linphone_chat_room_init(); -extern LinphoneParticipant * _linphone_participant_init(); +extern LinphoneChatRoom * _linphone_ChatRoom_init(); +extern LinphoneParticipant * _linphone_Participant_init(); using namespace std; @@ -101,11 +101,11 @@ void ClientGroupChatRoom::onParticipantAdded (const Address &addr) { } participant = make_shared(addr); participants.push_back(participant); - LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this->shared_from_this(), ChatRoom, chat_room); + LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this->shared_from_this(), ChatRoom); LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(cr); LinphoneChatRoomCbsParticipantAddedCb cb = linphone_chat_room_cbs_get_participant_added(cbs); if (cb) - cb(cr, L_GET_C_BACK_PTR(participant, Participant, participant)); + cb(cr, L_GET_C_BACK_PTR(participant, Participant)); } void ClientGroupChatRoom::onParticipantRemoved (const Address &addr) { @@ -114,11 +114,11 @@ void ClientGroupChatRoom::onParticipantRemoved (const Address &addr) { lWarning() << "Participant " << participant << " removed but not in the list of participants!"; return; } - LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this->shared_from_this(), ChatRoom, chat_room); + LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this->shared_from_this(), ChatRoom); LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(cr); LinphoneChatRoomCbsParticipantRemovedCb cb = linphone_chat_room_cbs_get_participant_removed(cbs); if (cb) - cb(cr, L_GET_C_BACK_PTR(participant, Participant, participant)); + cb(cr, L_GET_C_BACK_PTR(participant, Participant)); participants.remove(participant); } @@ -129,11 +129,11 @@ void ClientGroupChatRoom::onParticipantSetAdmin (const Address &addr, bool isAdm return; } participant->setAdmin(isAdmin); - LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this->shared_from_this(), ChatRoom, chat_room); + LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this->shared_from_this(), ChatRoom); LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(cr); LinphoneChatRoomCbsParticipantAdminStatusChangedCb cb = linphone_chat_room_cbs_get_participant_admin_status_changed(cbs); if (cb) - cb(cr, L_GET_C_BACK_PTR(participant, Participant, participant), isAdmin); + cb(cr, L_GET_C_BACK_PTR(participant, Participant), isAdmin); } LINPHONE_END_NAMESPACE diff --git a/src/chat/real-time-text-chat-room.cpp b/src/chat/real-time-text-chat-room.cpp index 8acb10ae6..9e9470f03 100644 --- a/src/chat/real-time-text-chat-room.cpp +++ b/src/chat/real-time-text-chat-room.cpp @@ -24,8 +24,8 @@ #include "c-wrapper/c-tools.h" #include "logger/logger.h" -extern LinphoneChatRoom * _linphone_chat_room_init(); -#define GET_BACK_PTR(object) L_GET_C_BACK_PTR(object->shared_from_this(), ChatRoom, chat_room) +extern LinphoneChatRoom * _linphone_ChatRoom_init(); +#define GET_BACK_PTR(object) L_GET_C_BACK_PTR(object->shared_from_this(), ChatRoom) // =============================================================================