From 033400ebcbb166089e56714a45ae0f4550ee5043 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 24 May 2001 17:20:22 +0000 Subject: [PATCH] fix for egcs internal compiler error git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10311 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/datetime.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index c04f928cee..d95ea2093a 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -3429,6 +3429,19 @@ bool wxDateTime::IsWorkDay(Country WXUNUSED(country)) const // wxTimeSpan // ============================================================================ +// this enum is only used in wxTimeSpan::Format() below but we can't declare +// it locally to the method as it provokes an internal compiler error in egcs +// 2.91.60 when building with -O2 +enum TimeSpanPart +{ + Part_Week, + Part_Day, + Part_Hour, + Part_Min, + Part_Sec, + Part_MSec +}; + // not all strftime(3) format specifiers make sense here because, for example, // a time span doesn't have a year nor a timezone // @@ -3466,15 +3479,7 @@ wxString wxTimeSpan::Format(const wxChar *format) const // should use GetMinutes() % 60, otherwise just GetMinutes() &c // we remember the most important unit found so far - enum TimeSpanPart - { - Part_Week, - Part_Day, - Part_Hour, - Part_Min, - Part_Sec, - Part_MSec - } partBiggest = Part_MSec; + TimeSpanPart partBiggest = Part_MSec; for ( const wxChar *pch = format; *pch; pch++ ) {