]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't rely on __GXX_RTTI being defined with g++ < 4.3.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 16 Apr 2010 12:44:30 +0000 (12:44 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 16 Apr 2010 12:44:30 +0000 (12:44 +0000)
__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

configure
configure.in
include/wx/platform.h

index 284ae5b9d86da52a9bdeb0ff655977134d6c7f42..f2978cb3457ba56d5cb6fe46ff09912f79443982 100755 (executable)
--- a/configure
+++ b/configure
@@ -42122,7 +42122,7 @@ fi
 
 if test "$GCC" = "yes" ; then
     if test "$wxUSE_NO_RTTI" = "yes" ; then
 
 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"
     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 <windows.h>
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <windows.h>
-#include <gdiplus.h>
+                     #include <gdiplus.h>
 int
 main ()
 {
 int
 main ()
 {
index e6bf454aeff8ebd40a4d7c90d081b19ab17674f6..70aa4f4e099083a88a3b154545b22a3a984b0bc7 100644 (file)
@@ -5408,7 +5408,10 @@ fi
 
 if test "$GCC" = "yes" ; then
     if test "$wxUSE_NO_RTTI" = "yes" ; then
 
 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"
     fi
     if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
         WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-exceptions"
index dd343949e5bd24cbcd04143ff2cb6bf643140672..713925585f7f2d29e61e77ed166456b93503dac4 100644 (file)
     g++) or by editing project files with MSVC so test for it here too.
  */
 #ifndef wxNO_RTTI
     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
 #       ifndef __GXX_RTTI
 #           define wxNO_RTTI
 #       endif