From df45d5f1f03d6ae2813512cbe07cf2b889577d87 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 13 Sep 2017 17:54:34 +0200 Subject: [PATCH] Allow adding additional fields when declaring a C struct. --- src/c-wrapper/c-tools.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/c-wrapper/c-tools.h b/src/c-wrapper/c-tools.h index ce811af34..0f4855089 100644 --- a/src/c-wrapper/c-tools.h +++ b/src/c-wrapper/c-tools.h @@ -158,10 +158,11 @@ LINPHONE_END_NAMESPACE // ----------------------------------------------------------------------------- -#define L_DECLARE_C_STRUCT_IMPL(STRUCT, C_NAME) \ +#define L_DECLARE_C_STRUCT_IMPL(STRUCT, C_NAME, ...) \ struct _Linphone ## STRUCT { \ belle_sip_object_t base; \ std::shared_ptr cppPtr; \ + __VA_ARGS__ \ }; \ BELLE_SIP_DECLARE_VPTR_NO_EXPORT(Linphone ## STRUCT); \ static Linphone ## STRUCT *_linphone_ ## C_NAME ## _init() { \ @@ -184,11 +185,12 @@ LINPHONE_END_NAMESPACE FALSE \ ); -#define L_DECLARE_C_CLONABLE_STRUCT_IMPL(CPP_CLASS, C_STRUCT, C_NAME) \ +#define L_DECLARE_C_CLONABLE_STRUCT_IMPL(CPP_CLASS, C_STRUCT, C_NAME, ...) \ struct _Linphone ## C_STRUCT { \ belle_sip_object_t base; \ void *userData; \ LINPHONE_NAMESPACE::CPP_CLASS *cppPtr; \ + __VA_ARGS__ \ }; \ BELLE_SIP_DECLARE_VPTR_NO_EXPORT(Linphone ## C_STRUCT); \ static Linphone ## C_STRUCT *_linphone_ ## C_NAME ## _init() { \