From 946ceed9cd2b7b0453c715110eb9a921febf8b3d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 12 Apr 2010 13:08:01 +0000 Subject: [PATCH] Fix VC6 compilation which was somehow broken by adding wxWeakRef ctor. For some mysterious reason, adding non-template wxWeakRef ctor breaks VC6 build with the apparently completely unrelated errors: include\wx/toplevel.h(223) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class wxWindow *' (or there is no acceptable conversion) include\wx/toplevel.h(231) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class wxWindow *' (or there is no acceptable conversion) src\common\dummy.cpp(27) : error C2856: #pragma hdrstop cannot be inside an #if block Simply don't define it for VC6 to at least allow the code not using wxWeakRef to compile. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63955 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/weakref.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/wx/weakref.h b/include/wx/weakref.h index df31c2fdc4..b767cafd0a 100644 --- a/include/wx/weakref.h +++ b/include/wx/weakref.h @@ -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); } +#endif // !__VISUALC6__ // When we have the full type here, static_cast<> will always work // (or give a straight compiler error). -- 2.45.2