Index: configure
===================================================================
--- configure	(revision 56232)
+++ configure	(working copy)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Id: configure.in 56132 2008-10-06 19:48:52Z SC .
+# From configure.in Id: configure.in 56190 2008-10-09 09:39:31Z VZ .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for wxWidgets 2.9.0.
 #
@@ -24329,7 +24329,81 @@
 
 fi
 
+{ echo "$as_me:$LINENO: checking whether the compiler supports dynamic_cast<>" >&5
+echo $ECHO_N "checking whether the compiler supports dynamic_cast<>... $ECHO_C" >&6; }
+if test "${ac_cv_cxx_dynamic_cast+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <typeinfo>
+class Base { public : Base () {} virtual void f () = 0;};
+class Derived : public Base { public : Derived () {} virtual void f () {} };
+int
+main ()
+{
+
+Derived d; Base& b=d; return dynamic_cast<Derived*>(&b) ? 0 : 1;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_cxx_dynamic_cast=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_cxx_dynamic_cast=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_cxx_dynamic_cast" >&5
+echo "${ECHO_T}$ac_cv_cxx_dynamic_cast" >&6; }
+if test "$ac_cv_cxx_dynamic_cast" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DYNAMIC_CAST
+_ACEOF
+
+fi
+
+
 if test "x$SUNCXX" = xyes; then
     CXXFLAGS="-features=tmplife $CXXFLAGS"
 fi
Index: include/wx/defs.h
===================================================================
--- include/wx/defs.h	(revision 56232)
+++ include/wx/defs.h	(working copy)
@@ -340,6 +340,12 @@
     #define wx_reinterpret_cast(t, x) ((t)(x))
 #endif
 
+#ifdef HAVE_DYNAMIC_CAST
+    #define wx_dynamic_cast( t, x ) dynamic_cast< t >( x )
+#else
+    #define wx_dynamic_cast( t, x ) wx_static_cast( t, x )
+#endif
+
 /*
    This one is a wx invention: like static cast but used when we intentionally
    truncate from a larger to smaller type, static_cast<> can't be used for it
Index: configure.in
===================================================================
--- configure.in	(revision 56232)
+++ configure.in	(working copy)
@@ -1752,8 +1752,7 @@
 AC_CXX_CONST_CAST
 AC_CXX_REINTERPRET_CAST
 AC_CXX_STATIC_CAST
-dnl we don't use HAVE_DYNAMIC_CAST anywhere right now...
-dnl AC_CXX_DYNAMIC_CAST
+AC_CXX_DYNAMIC_CAST
 
 dnl With Sun CC, temporaries have block scope by default. This flag is needed
 dnl to get the expression scope behaviour that conforms to the standard.
