]> git.saurik.com Git - wxWidgets.git/commitdiff
Implement string inserter for long long. This creates a problem on mingw as gcc
authorMichael Wetherell <mike.wetherell@ntlworld.com>
Sat, 15 Oct 2005 19:16:59 +0000 (19:16 +0000)
committerMichael Wetherell <mike.wetherell@ntlworld.com>
Sat, 15 Oct 2005 19:16:59 +0000 (19:16 +0000)
gives a warning unless -Wno-format is used, one of the most useful warnings.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35906 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

configure
configure.in
include/wx/string.h

index 184556c45dca3894eecf2e38b03aa9190f363198..d717259309e2721a96785cf3a76fd5f2d7ba9221 100755 (executable)
--- a/configure
+++ b/configure
@@ -43452,6 +43452,11 @@ if test "x$INTELCXX" = "xyes" ; then
                                                             CXXWARNINGS="-Wall -wd279,383,444,810,869,981,1418,1419"
 elif test "$GXX" = yes ; then
         CXXWARNINGS="-Wall -Wundef -Wno-ctor-dtor-privacy"
+
+                    case "${host}" in
+        *-*-cygwin* | *-*-mingw32* )
+            CXXWARNINGS="$CXXWARNINGS -Wno-format"
+    esac
 fi
 
 EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE"
index a61b1710fe21460d7fb426037e071a00c5b9f162..4ab3e0caa5f00b6f43f2a27555272444446205b6 100644 (file)
@@ -6969,6 +6969,15 @@ if test "x$INTELCXX" = "xyes" ; then
 elif test "$GXX" = yes ; then
     dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror"
     CXXWARNINGS="-Wall -Wundef -Wno-ctor-dtor-privacy" 
+
+    dnl -Wno-format is a terrifically useful warning, however mingw warns
+    dnl whenever the I64 format specifier is used for long long.
+    dnl FIXME: it we detected when cygwin is using -mno-cygwin we could avoid
+    dnl disabling it for cygwin.
+    case "${host}" in
+        *-*-cygwin* | *-*-mingw32* )
+            CXXWARNINGS="$CXXWARNINGS -Wno-format"
+    esac
 fi
 
 EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE"
index 151ca4037a0b6ef5ff6efe04bc44c8fadba0cd23..844cfa9f81f63e00095c258870b27585f5623ac0 100644 (file)
@@ -955,6 +955,14 @@ public:
       // insert an unsigned long into string
   wxString& operator<<(unsigned long ul)
     { return (*this) << Format(_T("%lu"), ul); }
+#if defined wxLongLong_t && !defined wxLongLongIsLong
+      // insert a long long if they exist and aren't longs
+  wxString& operator<<(wxLongLong_t ll)
+    { return (*this) << Format(_T("%") wxLongLongFmtSpec _T("d"), ll); }
+      // insert an unsigned long long
+  wxString& operator<<(wxULongLong_t ull)
+    { return (*this) << Format(_T("%") wxLongLongFmtSpec _T("u"), ull); }
+#endif
       // insert a float into string
   wxString& operator<<(float f)
     { return (*this) << Format(_T("%f"), f); }