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
This commit is contained in:
Vadim Zeitlin
2010-04-12 13:08:01 +00:00
parent c6d9001128
commit 946ceed9cd

View File

@@ -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).