X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f49735950644f04c639b3bdfc7b6cf23ac9ad9e2..f530fa27a92ea58071c83aa7bfe0a859626b39e7:/acinclude.m4 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<>,