]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datetime.cpp
fixed GetFreeMemory decl. to match wxWidgets
[wxWidgets.git] / src / common / datetime.cpp
index c4425617ed0fcd4d2255a0aab1cf28569e507287..282fde1baeb6b3ef85c2df0674ec41b19747ea5c 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        wx/datetime.h
+// Name:        src/common/datetime.cpp
 // Purpose:     implementation of time/date related classes
 // Author:      Vadim Zeitlin
 // Modified by:
@@ -392,9 +392,9 @@ static wxString CallStrftime(const wxChar *format, const tm* tm)
 
 #ifdef HAVE_STRPTIME
 
-// glibc2 doesn't define this in the headers unless _XOPEN_SOURCE is defined
-// which, unfortunately, wreaks havoc elsewhere
-#if defined(__GLIBC__) && (__GLIBC__ == 2)
+#if wxUSE_UNIX && !defined(HAVE_STRPTIME_DECL)
+    // configure detected that we had strptime() but not its declaration,
+    // provide it ourselves
     extern "C" char *strptime(const char *, const char *, struct tm *);
 #endif
 
@@ -2373,23 +2373,23 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
 
                         // find two strings not occurring in format (this is surely
                         // not the optimal way of doing it... improvements welcome!)
-                        wxString fmt = format;
+                        wxString fmt2 = format;
                         wxString replacement = (wxChar)-1;
-                        while ( fmt.Find(replacement) != wxNOT_FOUND )
+                        while ( fmt2.Find(replacement) != wxNOT_FOUND )
                         {
                             replacement << (wxChar)-1;
                         }
 
                         wxString replacement2 = (wxChar)-2;
-                        while ( fmt.Find(replacement) != wxNOT_FOUND )
+                        while ( fmt2.Find(replacement) != wxNOT_FOUND )
                         {
                             replacement << (wxChar)-2;
                         }
 
                         // replace all occurrences of year with it
-                        bool wasReplaced = fmt.Replace(strYear, replacement) > 0;
+                        bool wasReplaced = fmt2.Replace(strYear, replacement) > 0;
                         if ( !wasReplaced )
-                            wasReplaced = fmt.Replace(strYear2, replacement2) > 0;
+                            wasReplaced = fmt2.Replace(strYear2, replacement2) > 0;
 
                         // use strftime() to format the same date but in supported
                         // year
@@ -2843,7 +2843,7 @@ const wxChar *wxDateTime::ParseRfc822Date(const wxChar* date)
 
             p += tz.length();
         }
-        
+
         // make it minutes
         offset *= MIN_PER_HOUR;
     }