From: Vadim Zeitlin Date: Fri, 16 Apr 2010 12:44:30 +0000 (+0000) Subject: Don't rely on __GXX_RTTI being defined with g++ < 4.3. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3017880eff92f202f26262fbcdf1744cb620e3e3?ds=sidebyside Don't rely on __GXX_RTTI being defined with g++ < 4.3. __GXX_RTTI is only defined since g++ 4.3.2 and so we can't rely on its absence as indicating the use of -fno-rtti switch with the older versions of the compiler, only do this for g++ 4.3+. Also define wxNO_RTTI from configure if --enable-no_rtti was used as we can't always detect it automatically. Closes #11955. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63995 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/configure b/configure index 284ae5b9d8..f2978cb345 100755 --- a/configure +++ b/configure @@ -42122,7 +42122,7 @@ fi if test "$GCC" = "yes" ; then if test "$wxUSE_NO_RTTI" = "yes" ; then - WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-rtti" + WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -DwxNO_RTTI -fno-rtti" fi if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-exceptions" @@ -47507,7 +47507,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include + #include int main () { diff --git a/configure.in b/configure.in index e6bf454aef..70aa4f4e09 100644 --- a/configure.in +++ b/configure.in @@ -5408,7 +5408,10 @@ fi if test "$GCC" = "yes" ; then if test "$wxUSE_NO_RTTI" = "yes" ; then - WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-rtti" + dnl Define wxNO_RTTI on the command line because only g++ 4.3 and later + dnl define __GXX_RTTI which allows us to detect the use of -fno-rtti + dnl switch but we need to do it manually for the older versions. + WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -DwxNO_RTTI -fno-rtti" fi if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-exceptions" diff --git a/include/wx/platform.h b/include/wx/platform.h index dd343949e5..713925585f 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -837,7 +837,11 @@ g++) or by editing project files with MSVC so test for it here too. */ #ifndef wxNO_RTTI -# ifdef __GNUG__ + /* + Only 4.3 defines __GXX_RTTI by default so its absence is not an + indication of disabled RTTI with the previous versions. + */ +# if wxCHECK_GCC_VERSION(4, 3) # ifndef __GXX_RTTI # define wxNO_RTTI # endif