X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/43aecc4dd77cf2ee596ada72448f5ca3e8011afe..6235846c0c15bdbabe2809eef87e4e12d6137bd2:/include/wx/weakref.h diff --git a/include/wx/weakref.h b/include/wx/weakref.h index df31c2fdc4..a59a7e4a0a 100644 --- a/include/wx/weakref.h +++ b/include/wx/weakref.h @@ -149,7 +149,7 @@ protected: DoAssign( pobj, ptbase ); } -#ifdef HAVE_DYNAMIC_CAST +#ifndef wxNO_RTTI void AssignHelper(T* pobj, wxInt2Type) { // A last way to get a trackable pointer @@ -165,7 +165,7 @@ protected: Release(); } } -#endif // HAVE_DYNAMIC_CAST +#endif // RTTI enabled void AssignCopy(const wxWeakRefImpl& wr) { @@ -211,12 +211,16 @@ public: // Default ctor wxWeakRef() { } + // Enabling this ctor for VC6 results in mysterious compilation failures in + // wx/window.h when assigning wxWindow pointers (FIXME-VC6) +#ifndef __VISUALC6__ // Ctor from the object of this type: this is needed as the template ctor // below is not used by at least g++4 when a literal NULL is used wxWeakRef(T *pobj) { - Assign(pobj); + this->Assign(pobj); } +#endif // !__VISUALC6__ // When we have the full type here, static_cast<> will always work // (or give a straight compiler error). @@ -235,7 +239,7 @@ public: wxWeakRef& operator=(const wxWeakRef& wr) { - AssignCopy(wr); + this->AssignCopy(wr); return *this; } @@ -250,7 +254,7 @@ public: }; -#ifdef HAVE_DYNAMIC_CAST +#ifndef wxNO_RTTI // Weak ref implementation assign objects are queried for wxTrackable // using dynamic_cast<> @@ -334,7 +338,7 @@ protected: T *m_pobj; }; -#endif // #ifdef HAVE_DYNAMIC_CAST +#endif // RTTI enabled // Provide some basic types of weak references