Commit 7e133528 authored by Ronan's avatar Ronan

feat(General): L_DECLARE_PRIVATE can declare a LINPHONE_NAMESPACE::Tester friend

parent 6c3bc0c0
......@@ -79,9 +79,12 @@ void l_assert (const char *condition, const char *file, int line);
#define L_UNLIKELY(EXPRESSION) EXPRESSION
#endif
// Allows access to private internal data.
// Gives a control to C Wrapper.
#define L_DECLARE_PRIVATE(CLASS) \
class ClonableObject;
class ClonableObjectPrivate;
class Object;
class ObjectPrivate;
#define L_INTERNAL_DECLARE_PRIVATE(CLASS) \
inline CLASS ## Private *getPrivate() { \
return reinterpret_cast<CLASS ## Private *>(mPrivate); \
} \
......@@ -91,10 +94,15 @@ void l_assert (const char *condition, const char *file, int line);
friend class CLASS ## Private; \
friend class Wrapper;
class ClonableObject;
class ClonableObjectPrivate;
class Object;
class ObjectPrivate;
// Allows access to private internal data.
// Gives a control to C Wrapper.
#ifndef LINPHONE_TESTER
#define L_DECLARE_PRIVATE(CLASS) L_INTERNAL_DECLARE_PRIVATE(CLASS)
#else
#define L_DECLARE_PRIVATE(CLASS) \
L_INTERNAL_DECLARE_PRIVATE(CLASS) \
friend class Tester;
#endif
template<typename T>
inline ClonableObject *getPublicHelper (T *object, ClonableObjectPrivate *context) {
......
......@@ -218,6 +218,8 @@ bc_apply_compile_flags(SOURCE_FILES_C STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
bc_apply_compile_flags(SOURCE_FILES_CXX STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX)
bc_apply_compile_flags(SOURCE_FILES_OBJC STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC)
add_definitions("-DLINPHONE_TESTER")
if(MSVC)
get_source_file_property(MESSAGE_TESTER_C_COMPILE_FLAGS message_tester.c COMPILE_FLAGS)
set(MESSAGE_TESTER_C_COMPILE_FLAGS "${MESSAGE_TESTER_C_COMPILE_FLAGS} /wd4996") # Disable "was declared deprecated" warnings
......
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