diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1d6327254..053557107 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,7 +40,6 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES db/provider/db-session-p.h db/provider/db-session-provider.h db/provider/db-session.h - enums.h event-log/call-event.h event-log/conference-event-p.h event-log/conference-event.h @@ -56,7 +55,9 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES object/object-p.h object/object.h object/singleton.h + utils/enum-generator.h utils/general.h + utils/magic-macros.h utils/utils.h ) diff --git a/src/c-wrapper/c-types.h b/src/c-wrapper/c-types.h index 51ff9cfe2..933b067b6 100644 --- a/src/c-wrapper/c-types.h +++ b/src/c-wrapper/c-types.h @@ -19,18 +19,25 @@ #ifndef _C_TYPES_H_ #define _C_TYPES_H_ -// Do not move these defines. -#define L_DECLARE_ENUM(CLASS, ENUM) enum Linphone ## CLASS ## ENUM -#define L_DECLARE_C_STRUCT(STRUCT) typedef struct _Linphone ## STRUCT Linphone ## STRUCT; +// Do not move this define. +// Enable C enums. +#define L_USE_C_ENUM #include "event-log/event-log-enums.h" +#define L_DECLARE_C_ENUM(CLASS, ENUM, VALUES) enum Linphone ## CLASS ## ENUM { VALUES } +#define L_DECLARE_C_STRUCT(STRUCT) typedef struct _Linphone ## STRUCT Linphone ## STRUCT; + // ============================================================================= #ifdef __cplusplus extern "C" { #endif +// ============================================================================= +// C Structures. +// ============================================================================= + L_DECLARE_C_STRUCT(Call); L_DECLARE_C_STRUCT(CallEvent); L_DECLARE_C_STRUCT(ConferenceEvent); @@ -42,6 +49,12 @@ L_DECLARE_C_STRUCT(MessageEvent); // TODO: Remove me in the future. typedef struct SalAddress LinphoneAddress; +// ============================================================================= +// C Enums. +// ============================================================================= + +L_DECLARE_C_ENUM(EventLog, Type, L_ENUM_VALUES_EVENT_LOG_TYPE); + #ifdef __cplusplus } #endif diff --git a/src/db/events-db.cpp b/src/db/events-db.cpp index 284fc3509..79e140e5c 100644 --- a/src/db/events-db.cpp +++ b/src/db/events-db.cpp @@ -252,17 +252,17 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {} bool EventsDb::addEvent (const EventLog &eventLog) { // TODO. switch (eventLog.getType()) { - case EventLog::NoneEvent: + case EventLog::TypeNone: return false; - case EventLog::MessageEvent: - case EventLog::CallStartEvent: - case EventLog::CallEndEvent: - case EventLog::ConferenceCreatedEvent: - case EventLog::ConferenceDestroyedEvent: - case EventLog::ConferenceParticipantAddedEvent: - case EventLog::ConferenceParticipantRemovedEvent: - case EventLog::ConferenceParticipantSetAdminEvent: - case EventLog::ConferenceParticipantUnsetAdminEvent: + case EventLog::TypeMessage: + case EventLog::TypeCallStart: + case EventLog::TypeCallEnd: + case EventLog::TypeConferenceCreated: + case EventLog::TypeConferenceDestroyed: + case EventLog::TypeConferenceParticipantAdded: + case EventLog::TypeConferenceParticipantRemoved: + case EventLog::TypeConferenceParticipantSetAdmin: + case EventLog::TypeConferenceParticipantUnsetAdmin: break; } diff --git a/src/event-log/call-event.cpp b/src/event-log/call-event.cpp index 0dde3edc9..1078606ec 100644 --- a/src/event-log/call-event.cpp +++ b/src/event-log/call-event.cpp @@ -36,7 +36,7 @@ public: CallEvent::CallEvent (Type type, const shared_ptr &call) : EventLog(*new CallEventPrivate, type) { L_D(CallEvent); L_ASSERT(call); - L_ASSERT(type == CallStartEvent || type == CallEndEvent); + L_ASSERT(type == TypeCallStart || type == TypeCallEnd); d->call = call; } diff --git a/src/event-log/conference-event.cpp b/src/event-log/conference-event.cpp index 169e9dfa5..cfb4ca69c 100644 --- a/src/event-log/conference-event.cpp +++ b/src/event-log/conference-event.cpp @@ -29,7 +29,7 @@ LINPHONE_BEGIN_NAMESPACE ConferenceEvent::ConferenceEvent (Type type, const shared_ptr &address) : EventLog(*new ConferenceEventPrivate, type) { L_D(ConferenceEvent); - L_ASSERT(type == ConferenceCreatedEvent || type == ConferenceDestroyedEvent); + L_ASSERT(type == TypeConferenceCreated || type == TypeConferenceDestroyed); L_ASSERT(address); // TODO: Duplicate address. d->address = address; diff --git a/src/event-log/conference-participant-event.cpp b/src/event-log/conference-participant-event.cpp index 4d3500144..0095da63a 100644 --- a/src/event-log/conference-participant-event.cpp +++ b/src/event-log/conference-participant-event.cpp @@ -40,10 +40,10 @@ ConferenceParticipantEvent::ConferenceParticipantEvent ( ) : ConferenceEvent(*new ConferenceParticipantEventPrivate, type, conferenceAddress) { L_D(ConferenceParticipantEvent); L_ASSERT( - type == ConferenceParticipantAddedEvent || - type == ConferenceParticipantRemovedEvent || - type == ConferenceParticipantSetAdminEvent || - type == ConferenceParticipantUnsetAdminEvent + type == TypeConferenceParticipantAdded || + type == TypeConferenceParticipantRemoved || + type == TypeConferenceParticipantSetAdmin || + type == TypeConferenceParticipantUnsetAdmin ); L_ASSERT(participantAddress); // TODO: Duplicate address. diff --git a/src/event-log/event-log-enums.h b/src/event-log/event-log-enums.h index 1542fdf54..878d1644b 100644 --- a/src/event-log/event-log-enums.h +++ b/src/event-log/event-log-enums.h @@ -19,25 +19,22 @@ #ifndef _EVENT_LOG_ENUMS_H_ #define _EVENT_LOG_ENUMS_H_ -#include "utils/general.h" +#include "utils/enum-generator.h" // ============================================================================= -L_DECLARE_ENUM(EventLog, Type) { - NoneEvent, - // MessageEvent. - MessageEvent, - // CallEvent. - CallStartEvent, - CallEndEvent, - // ConferenceEvent. - ConferenceCreatedEvent, - ConferenceDestroyedEvent, - // ConferenceParticipantEvent. - ConferenceParticipantAddedEvent, - ConferenceParticipantRemovedEvent, - ConferenceParticipantSetAdminEvent, - ConferenceParticipantUnsetAdminEvent -}; +#define L_ENUM_VALUES_EVENT_LOG_TYPE \ + L_DECLARE_ENUM_VALUES(EventLog, Type, \ + None, \ + Message, \ + CallStart, \ + CallEnd, \ + ConferenceCreated, \ + ConferenceDestroyed, \ + ConferenceParticipantAdded, \ + ConferenceParticipantRemoved, \ + ConferenceParticipantSetAdmin, \ + ConferenceParticipantUnsetAdmin \ + ) #endif // ifndef _EVENT_LOG_ENUMS_H_ diff --git a/src/event-log/event-log-p.h b/src/event-log/event-log-p.h index e9e266178..6a71e025f 100644 --- a/src/event-log/event-log-p.h +++ b/src/event-log/event-log-p.h @@ -28,7 +28,7 @@ LINPHONE_BEGIN_NAMESPACE class EventLogPrivate : public ClonableObjectPrivate { private: - EventLog::Type type = EventLog::NoneEvent; + EventLog::Type type = EventLog::TypeNone; L_DECLARE_PUBLIC(EventLog); }; diff --git a/src/event-log/event-log.h b/src/event-log/event-log.h index 180a09e44..831fca24f 100644 --- a/src/event-log/event-log.h +++ b/src/event-log/event-log.h @@ -20,6 +20,7 @@ #define _EVENT_LOG_H_ #include "object/clonable-object.h" +#include "event-log-enums.h" // ============================================================================= @@ -29,7 +30,9 @@ class EventLogPrivate; class LINPHONE_PUBLIC EventLog : public ClonableObject { public: - enum Type : int; + enum Type { + L_ENUM_VALUES_EVENT_LOG_TYPE + }; EventLog (); EventLog (const EventLog &src); @@ -46,8 +49,6 @@ private: L_DECLARE_PRIVATE(EventLog); }; -#include "event-log-enums.h" - LINPHONE_END_NAMESPACE #endif // ifndef _EVENT_LOG_H_ diff --git a/src/event-log/message-event.cpp b/src/event-log/message-event.cpp index d46af4102..cda82eb68 100644 --- a/src/event-log/message-event.cpp +++ b/src/event-log/message-event.cpp @@ -34,7 +34,7 @@ public: // ----------------------------------------------------------------------------- MessageEvent::MessageEvent (const shared_ptr &message) : - EventLog(*new MessageEventPrivate, EventLog::MessageEvent) { + EventLog(*new MessageEventPrivate, EventLog::TypeMessage) { L_D(MessageEvent); L_ASSERT(message); d->message = message; diff --git a/src/message/message.h b/src/message/message.h index 61754010b..3bb643315 100644 --- a/src/message/message.h +++ b/src/message/message.h @@ -23,7 +23,6 @@ #include #include -#include "enums.h" #include "object/object.h" // ============================================================================= diff --git a/src/enums.h b/src/utils/enum-generator.h similarity index 63% rename from src/enums.h rename to src/utils/enum-generator.h index 78f0d1ed5..994948d57 100644 --- a/src/enums.h +++ b/src/utils/enum-generator.h @@ -1,5 +1,5 @@ /* - * enums.h + * enum-generator.h * Copyright (C) 2017 Belledonne Communications SARL * * This program is free software: you can redistribute it and/or modify @@ -16,17 +16,25 @@ * along with this program. If not, see . */ -#ifndef _ENUMS_H_ -#define _ENUMS_H_ +#ifndef _ENUM_GENERATOR_H_ +#define _ENUM_GENERATOR_H_ -#include "utils/general.h" +#include "magic-macros.h" // ============================================================================= LINPHONE_BEGIN_NAMESPACE -// Nothing. for the moment. +#define L_ENUM_VALUE(C, VALUE) C ## VALUE + +#ifndef L_USE_C_ENUM + #define L_DECLARE_ENUM_VALUES(CLASS_NAME, ENUM_NAME, ...) \ + MM_APPLY_COMMA(L_ENUM_VALUE, ENUM_NAME, __VA_ARGS__) +#else + #define L_DECLARE_ENUM_VALUES(CLASS_NAME, ENUM_NAME, ...) \ + MM_APPLY_COMMA(L_ENUM_VALUE, Linphone ## CLASS_NAME ## ENUM_NAME, __VA_ARGS__) +#endif // ifndef L_USE_C_ENUM LINPHONE_END_NAMESPACE -#endif // ifndef _ENUMS_H_ +#endif // ifndef _ENUM_GENERATOR_H_ diff --git a/src/utils/general.h b/src/utils/general.h index 2291c43eb..fd1ebb9eb 100644 --- a/src/utils/general.h +++ b/src/utils/general.h @@ -55,10 +55,6 @@ LINPHONE_BEGIN_NAMESPACE #ifdef __cplusplus -#ifndef L_DECLARE_ENUM - #define L_DECLARE_ENUM(CLASS, ENUM) enum CLASS::ENUM : int -#endif - void l_assert (const char *condition, const char *file, int line); #ifdef DEBUG diff --git a/src/utils/magic-macros.h b/src/utils/magic-macros.h new file mode 100644 index 000000000..95b2f9774 --- /dev/null +++ b/src/utils/magic-macros.h @@ -0,0 +1,240 @@ +/* + * magic-macros.h + * Copyright (C) 2017 Belledonne Communications SARL + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef _MAGIC_MACROS_H_ +#define _MAGIC_MACROS_H_ + +#include "general.h" + +// ============================================================================= +// Original header. +// Source: https://github.com/facebookresearch/ELF/blob/master/elf/pybind_helper.h +// ============================================================================= + +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +// File: macros.h +// Author: Yuxin Wu + +// ============================================================================= + +LINPHONE_BEGIN_NAMESPACE + +#define MM_CONCAT__(A, B) A ## B +#define MM_CONCAT_(A, B) MM_CONCAT__(A, B) +#define MM_CONCAT(A, B) MM_CONCAT_(A, B) + +#define MM_INVOKE(MACRO, ARGS) MACRO ARGS +#define MM_INVOKE_B(MACRO, ARGS) MACRO ARGS + +#define MM_APPLY_1(MACRONAME, C, A1) \ + MM_INVOKE_B(MACRONAME, (C, A1)) + +#define MM_APPLY_2(MACRONAME, C, A1, A2) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_1(MACRONAME, C, A2) + +#define MM_APPLY_3(MACRONAME, C, A1, A2, A3) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_2(MACRONAME, C, A2, A3) + +#define MM_APPLY_4(MACRONAME, C, A1, A2, A3, A4) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_3(MACRONAME, C, A2, A3, A4) + +#define MM_APPLY_5(MACRONAME, C, A1, A2, A3, A4, A5) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_4(MACRONAME, C, A2, A3, A4, A5) + +#define MM_APPLY_6(MACRONAME, C, A1, A2, A3, A4, A5, A6) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_5(MACRONAME, C, A2, A3, A4, A5, A6) + +#define MM_APPLY_7(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_6(MACRONAME, C, A2, A3, A4, A5, A6, A7) + +#define MM_APPLY_8(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_7(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8) + +#define MM_APPLY_9(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_8(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9) + +#define MM_APPLY_10(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_9(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10) + +#define MM_APPLY_11(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_10(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) + +#define MM_APPLY_12(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_11(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) + +#define MM_APPLY_13(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_12(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) + +#define MM_APPLY_14(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_13(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) + +#define MM_APPLY_15(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_14(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) + +#define MM_APPLY_16(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_15(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) + +#define MM_APPLY_17(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_16(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) + +#define MM_APPLY_18(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_17(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) + +#define MM_APPLY_19(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_18(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) + +#define MM_APPLY_20(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_19(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) + +#define MM_APPLY_21(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_20(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) + +#define MM_APPLY_22(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22) \ + MM_INVOKE_B(MACRONAME, (C, A1)) \ + MM_APPLY_21(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22) + +#define MM_NARG(...) \ + MM_NARG_(__VA_ARGS__, MM_RSEQ_N()) + +#define MM_NARG_(...) \ + MM_ARG_N(__VA_ARGS__) + +#define MM_ARG_N( \ + _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, \ + _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, \ + _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, \ + _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, \ + _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, \ + _61, _62, _63, N, ...) N + +#define MM_RSEQ_N() \ + 63, 62, 61, 60, \ + 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, \ + 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, \ + 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, \ + 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, \ + 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, \ + 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 + +#define MM_APPLY(MACRONAME, C, ...) \ + MM_INVOKE( \ + MM_CONCAT(MM_APPLY_, MM_NARG(__VA_ARGS__)), \ + (MACRONAME, C, __VA_ARGS__) \ + ) + +#define MM_APPLY_COMMA(MACRONAME, C, ...) \ + MM_INVOKE( \ + MM_CONCAT(MM_APPLY_COMMA_, MM_NARG(__VA_ARGS__)), \ + (MACRONAME, C, __VA_ARGS__) \ + ) + +#define MM_APPLY_COMMA_1(MACRONAME, C, A1) \ + MM_INVOKE_B(MACRONAME, (C, A1)) + +#define MM_APPLY_COMMA_2(MACRONAME, C, A1, A2) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_1(MACRONAME, C, A2) + +#define MM_APPLY_COMMA_3(MACRONAME, C, A1, A2, A3) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_2(MACRONAME, C, A2, A3) + +#define MM_APPLY_COMMA_4(MACRONAME, C, A1, A2, A3, A4) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_3(MACRONAME, C, A2, A3, A4) + +#define MM_APPLY_COMMA_5(MACRONAME, C, A1, A2, A3, A4, A5) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_4(MACRONAME, C, A2, A3, A4, A5) + +#define MM_APPLY_COMMA_6(MACRONAME, C, A1, A2, A3, A4, A5, A6) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_5(MACRONAME, C, A2, A3, A4, A5, A6) + +#define MM_APPLY_COMMA_7(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_6(MACRONAME, C, A2, A3, A4, A5, A6, A7) + +#define MM_APPLY_COMMA_8(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_7(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8) + +#define MM_APPLY_COMMA_9(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_8(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9) + +#define MM_APPLY_COMMA_10(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_9(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10) + +#define MM_APPLY_COMMA_11(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_10(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) + +#define MM_APPLY_COMMA_12(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_11(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) + +#define MM_APPLY_COMMA_13(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_12(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) + +#define MM_APPLY_COMMA_14(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_13(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) + +#define MM_APPLY_COMMA_15(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_14(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) + +#define MM_APPLY_COMMA_16(MACRONAME, C, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) \ + MM_INVOKE_B(MACRONAME, (C, A1)), \ + MM_APPLY_COMMA_15(MACRONAME, C, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) + +LINPHONE_END_NAMESPACE + +#endif // ifndef _MAGIC_MACROS_H_