Merge branch 'clang-no-rtti'

Fix wxGTK compilation without RTTI and clang-related no-rtti fixes.

See https://github.com/wxWidgets/wxWidgets/pull/1266
This commit is contained in:
Vadim Zeitlin
2019-03-21 02:43:22 +01:00
3 changed files with 15 additions and 2 deletions

View File

@@ -611,7 +611,11 @@
Only 4.3 defines __GXX_RTTI by default so its absence is not an Only 4.3 defines __GXX_RTTI by default so its absence is not an
indication of disabled RTTI with the previous versions. indication of disabled RTTI with the previous versions.
*/ */
# if wxCHECK_GCC_VERSION(4, 3) # if defined(__clang__)
# if !__has_feature(cxx_rtti)
# define wxNO_RTTI
# endif
# elif wxCHECK_GCC_VERSION(4, 3)
# ifndef __GXX_RTTI # ifndef __GXX_RTTI
# define wxNO_RTTI # define wxNO_RTTI
# endif # endif

View File

@@ -106,7 +106,7 @@ typedef void (*wxTypeIdentifier)();
// WX_DECLARE_TYPEINFO() or WX_DECLARE_TYPEINFO_INLINE() however. // WX_DECLARE_TYPEINFO() or WX_DECLARE_TYPEINFO_INLINE() however.
#define _WX_DECLARE_TYPEINFO_CUSTOM(CLS, IDENTFUNC) \ #define _WX_DECLARE_TYPEINFO_CUSTOM(CLS, IDENTFUNC) \
public: \ public: \
virtual wxTypeIdentifier GetWxTypeId() const \ virtual wxTypeIdentifier GetWxTypeId() const wxOVERRIDE \
{ \ { \
return reinterpret_cast<wxTypeIdentifier> \ return reinterpret_cast<wxTypeIdentifier> \
(&IDENTFUNC); \ (&IDENTFUNC); \

View File

@@ -1750,6 +1750,15 @@ struct wxGridCellDateEditorKeyHandler
} }
wxGridCellEditorEvtHandler* m_handler; wxGridCellEditorEvtHandler* m_handler;
#ifdef wxNO_RTTI
// wxEventFunctorFunction used when an object of this class is passed to
// Bind() must have a default ctor when using wx RTTI implementation (see
// see the comment before WX_DECLARE_TYPEINFO_INLINE() in wx/typeinfo.h)
// and this, in turn, requires a default ctor of this class -- which will
// never be actually used, but must nevertheless exist.
wxGridCellDateEditorKeyHandler() : m_handler(NULL) { }
#endif // wxNO_RTTI
}; };
#endif // __WXGTK__ #endif // __WXGTK__