From 1b2e103da9ce1fe5e2455741700b62307634a94e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 22 Sep 2017 09:21:23 +0200 Subject: [PATCH] feat(c-wrapper): remove CPP_CLASS parameter of L_DECLARE_C_STRUCT_IMPL --- src/c-wrapper/api/c-call.cpp | 2 +- src/c-wrapper/api/c-chat-message.cpp | 2 +- src/c-wrapper/api/c-chat-room.cpp | 2 +- src/c-wrapper/api/c-participant.cpp | 2 +- src/c-wrapper/internal/c-tools.h | 16 ++++++++-------- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/c-wrapper/api/c-call.cpp b/src/c-wrapper/api/c-call.cpp index e257e1dbb..02fb800a7 100644 --- a/src/c-wrapper/api/c-call.cpp +++ b/src/c-wrapper/api/c-call.cpp @@ -36,7 +36,7 @@ using namespace std; static void _linphone_call_constructor (LinphoneCall *call); static void _linphone_call_destructor (LinphoneCall *call); -L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(Call, Call, +L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(Call, _linphone_call_constructor, _linphone_call_destructor, bctbx_list_t *callbacks; /* A list of LinphoneCallCbs object */ LinphoneCallCbs *currentCbs; /* The current LinphoneCallCbs object used to call a callback */ diff --git a/src/c-wrapper/api/c-chat-message.cpp b/src/c-wrapper/api/c-chat-message.cpp index afb079ff4..c1b157220 100644 --- a/src/c-wrapper/api/c-chat-message.cpp +++ b/src/c-wrapper/api/c-chat-message.cpp @@ -38,7 +38,7 @@ using namespace std; static void _linphone_chat_message_constructor (LinphoneChatMessage *msg); static void _linphone_chat_message_destructor (LinphoneChatMessage *msg); -L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(ChatMessage, ChatMessage, +L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(ChatMessage, _linphone_chat_message_constructor, _linphone_chat_message_destructor, LinphoneChatMessageCbs *cbs; LinphoneChatRoom* chat_room; diff --git a/src/c-wrapper/api/c-chat-room.cpp b/src/c-wrapper/api/c-chat-room.cpp index f2662f08c..ca7316fa5 100644 --- a/src/c-wrapper/api/c-chat-room.cpp +++ b/src/c-wrapper/api/c-chat-room.cpp @@ -38,7 +38,7 @@ 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, + ChatRoom, _linphone_chat_room_constructor, _linphone_chat_room_destructor, LinphoneChatRoomCbs *cbs; LinphoneAddress *peerAddressCache; diff --git a/src/c-wrapper/api/c-participant.cpp b/src/c-wrapper/api/c-participant.cpp index 05e0169ff..d79ee04d2 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, +L_DECLARE_C_STRUCT_IMPL(Participant, mutable LinphoneAddress *addressCache; ); diff --git a/src/c-wrapper/internal/c-tools.h b/src/c-wrapper/internal/c-tools.h index e05eebd79..051048316 100644 --- a/src/c-wrapper/internal/c-tools.h +++ b/src/c-wrapper/internal/c-tools.h @@ -271,11 +271,11 @@ LINPHONE_END_NAMESPACE #define L_INTERNAL_C_STRUCT_NO_XTOR(OBJECT) -#define L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, CONSTRUCTOR, DESTRUCTOR) \ +#define L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(C_TYPE, CONSTRUCTOR, DESTRUCTOR) \ BELLE_SIP_DECLARE_VPTR_NO_EXPORT(Linphone ## C_TYPE); \ Linphone ## C_TYPE *_linphone_ ## C_TYPE ## _init() { \ Linphone ## C_TYPE * object = belle_sip_object_new(Linphone ## C_TYPE); \ - new(&object->cppPtr) std::shared_ptr(); \ + new(&object->cppPtr) std::shared_ptr(); \ CONSTRUCTOR(object); \ return object; \ } \ @@ -328,22 +328,22 @@ LINPHONE_END_NAMESPACE // ----------------------------------------------------------------------------- // Declare wrapped C object with constructor/destructor. -#define L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(CPP_CLASS, C_TYPE, CONSTRUCTOR, DESTRUCTOR, ...) \ +#define L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(C_TYPE, CONSTRUCTOR, DESTRUCTOR, ...) \ struct _Linphone ## C_TYPE { \ belle_sip_object_t base; \ - std::shared_ptr cppPtr; \ + std::shared_ptr cppPtr; \ __VA_ARGS__ \ }; \ - L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, CONSTRUCTOR, DESTRUCTOR) + L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(C_TYPE, CONSTRUCTOR, DESTRUCTOR) // Declare wrapped C object. -#define L_DECLARE_C_STRUCT_IMPL(CPP_CLASS, C_TYPE, ...) \ +#define L_DECLARE_C_STRUCT_IMPL(C_TYPE, ...) \ struct _Linphone ## C_TYPE { \ belle_sip_object_t base; \ - std::shared_ptr cppPtr; \ + std::shared_ptr cppPtr; \ __VA_ARGS__ \ }; \ - L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, L_INTERNAL_C_STRUCT_NO_XTOR, L_INTERNAL_C_STRUCT_NO_XTOR) + L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(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(C_TYPE, ...) \