From: Vadim Zeitlin Date: Tue, 28 Sep 2004 21:44:59 +0000 (+0000) Subject: added AC_CXX_REINTERPRET_CAST X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4eeb39ab7c4d4df99881fe3c70699522b2ae51ed added AC_CXX_REINTERPRET_CAST git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/acinclude.m4 b/acinclude.m4 index 5402dd104d..6269f806f4 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -595,6 +595,27 @@ if test "$ac_cv_cxx_const_cast" = yes; then fi ]) +dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_reinterpret_cast.html +AC_DEFUN([AC_CXX_REINTERPRET_CAST], +[AC_CACHE_CHECK(whether the compiler supports reinterpret_cast<>, +ac_cv_cxx_reinterpret_cast, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include +class Base { public : Base () {} virtual void f () = 0;}; +class Derived : public Base { public : Derived () {} virtual void f () {} }; +class Unrelated { public : Unrelated () {} }; +int g (Unrelated&) { return 0; }],[ +Derived d;Base& b=d;Unrelated& e=reinterpret_cast(b);return g(e);], + ac_cv_cxx_reinterpret_cast=yes, ac_cv_cxx_reinterpret_cast=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_reinterpret_cast" = yes; then + AC_DEFINE(HAVE_REINTERPRET_CAST,, + [define if the compiler supports reinterpret_cast<>]) +fi +]) + dnl and http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_static_cast.html AC_DEFUN([AC_CXX_STATIC_CAST], [AC_CACHE_CHECK(whether the compiler supports static_cast<>,