]> git.saurik.com Git - wxWidgets.git/commitdiff
workaround for Borland compilation: don't use unspecified_bool_type for it
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 25 Apr 2009 14:07:15 +0000 (14:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 25 Apr 2009 14:07:15 +0000 (14:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60347 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/scopedptr.h

index a27b8dbd6b703c8093197d4200518ba5ff7a9fc7..515c7fc383f1f648cc6a0288314440132af862af 100644 (file)
@@ -47,7 +47,13 @@ public:
 
     // test for pointer validity: defining conversion to unspecified_bool_type
     // and not more obvious bool to avoid implicit conversions to integer types
 
     // test for pointer validity: defining conversion to unspecified_bool_type
     // and not more obvious bool to avoid implicit conversions to integer types
+#ifdef __BORLANDC__
+    // this compiler is too dumb to use unspecified_bool_type operator in tests
+    // of the form "if ( !ptr )"
+    typedef bool unspecified_bool_type;
+#else
     typedef T *(wxScopedPtr<T>::*unspecified_bool_type)() const;
     typedef T *(wxScopedPtr<T>::*unspecified_bool_type)() const;
+#endif // __BORLANDC__
     operator unspecified_bool_type() const
     {
         return m_ptr ? &wxScopedPtr<T>::get : NULL;
     operator unspecified_bool_type() const
     {
         return m_ptr ? &wxScopedPtr<T>::get : NULL;