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