Commit 1b2e103d authored by Ronan's avatar Ronan

feat(c-wrapper): remove CPP_CLASS parameter of L_DECLARE_C_STRUCT_IMPL

parent bc113345
......@@ -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 */
......
......@@ -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;
......
......@@ -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;
......
......@@ -25,7 +25,7 @@
using namespace std;
L_DECLARE_C_STRUCT_IMPL(Participant, Participant,
L_DECLARE_C_STRUCT_IMPL(Participant,
mutable LinphoneAddress *addressCache;
);
......
......@@ -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<LINPHONE_NAMESPACE::CPP_CLASS>(); \
new(&object->cppPtr) std::shared_ptr<L_CPP_TYPE_OF_C_TYPE(C_TYPE)>(); \
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<LINPHONE_NAMESPACE::CPP_CLASS> cppPtr; \
std::shared_ptr<L_CPP_TYPE_OF_C_TYPE(C_TYPE)> 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<LINPHONE_NAMESPACE::CPP_CLASS> cppPtr; \
std::shared_ptr<L_CPP_TYPE_OF_C_TYPE(C_TYPE)> 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, ...) \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment