Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
7e133528
Commit
7e133528
authored
Sep 28, 2017
by
Ronan
Browse files
feat(General): L_DECLARE_PRIVATE can declare a LINPHONE_NAMESPACE::Tester friend
parent
6c3bc0c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
include/linphone/utils/general.h
include/linphone/utils/general.h
+15
-7
tester/CMakeLists.txt
tester/CMakeLists.txt
+2
-0
No files found.
include/linphone/utils/general.h
View file @
7e133528
...
...
@@ -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
)
{
...
...
tester/CMakeLists.txt
View file @
7e133528
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment