fix(general): avoid invalid cast on Windows with L_DECLARE_PRIVATE macro

This commit is contained in:
Ronan Abhamon 2018-05-16 14:18:13 +02:00
parent fdac4f1cee
commit 76d2303c40

View file

@ -189,15 +189,13 @@ namespace Private {
#define L_INTERNAL_DECLARE_PRIVATE(CLASS) \
inline CLASS ## Private *getPrivate () { \
L_INTERNAL_CHECK_OBJECT_INHERITANCE(CLASS); \
return reinterpret_cast<CLASS ## Private *>( \
LinphonePrivate::Private::BetterPrivateAncestor<CLASS>::mPrivate \
); \
using TypeAncestor = LinphonePrivate::Private::BetterPrivateAncestor<CLASS>; \
return reinterpret_cast<CLASS ## Private *>(TypeAncestor::mPrivate); \
} \
inline const CLASS ## Private *getPrivate () const { \
L_INTERNAL_CHECK_OBJECT_INHERITANCE(CLASS); \
return reinterpret_cast<const CLASS ## Private *>( \
LinphonePrivate::Private::BetterPrivateAncestor<CLASS>::mPrivate \
); \
using TypeAncestor = LinphonePrivate::Private::BetterPrivateAncestor<CLASS>; \
return reinterpret_cast<const CLASS ## Private *>(TypeAncestor::mPrivate); \
} \
friend class CLASS ## Private; \
friend class Wrapper;