diff options
Diffstat (limited to 'contrib/libstdc++/config/locale/generic/time_members.cc')
-rw-r--r-- | contrib/libstdc++/config/locale/generic/time_members.cc | 202 |
1 files changed, 104 insertions, 98 deletions
diff --git a/contrib/libstdc++/config/locale/generic/time_members.cc b/contrib/libstdc++/config/locale/generic/time_members.cc index df43f03..6e2f755 100644 --- a/contrib/libstdc++/config/locale/generic/time_members.cc +++ b/contrib/libstdc++/config/locale/generic/time_members.cc @@ -1,6 +1,6 @@ // std::time_get, std::time_put implementation, generic version -*- C++ -*- -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -55,65 +55,68 @@ namespace std void __timepunct<char>::_M_initialize_timepunct(__c_locale) { - // "C" locale - _M_date_format = "%m/%d/%y"; - _M_date_era_format = "%m/%d/%y"; - _M_time_format = "%H:%M:%S"; - _M_time_era_format = "%H:%M:%S"; - _M_date_time_format = ""; - _M_date_time_era_format = ""; - _M_am = "AM"; - _M_pm = "PM"; - _M_am_pm_format = ""; + // "C" locale. + if (!_M_data) + _M_data = new __timepunct_cache<char>; + + _M_data->_M_date_format = "%m/%d/%y"; + _M_data->_M_date_era_format = "%m/%d/%y"; + _M_data->_M_time_format = "%H:%M:%S"; + _M_data->_M_time_era_format = "%H:%M:%S"; + _M_data->_M_date_time_format = ""; + _M_data->_M_date_time_era_format = ""; + _M_data->_M_am = "AM"; + _M_data->_M_pm = "PM"; + _M_data->_M_am_pm_format = ""; // Day names, starting with "C"'s Sunday. - _M_day1 = "Sunday"; - _M_day2 = "Monday"; - _M_day3 = "Tuesday"; - _M_day4 = "Wednesday"; - _M_day5 = "Thursday"; - _M_day6 = "Friday"; - _M_day7 = "Saturday"; + _M_data->_M_day1 = "Sunday"; + _M_data->_M_day2 = "Monday"; + _M_data->_M_day3 = "Tuesday"; + _M_data->_M_day4 = "Wednesday"; + _M_data->_M_day5 = "Thursday"; + _M_data->_M_day6 = "Friday"; + _M_data->_M_day7 = "Saturday"; // Abbreviated day names, starting with "C"'s Sun. - _M_day_a1 = "Sun"; - _M_day_a2 = "Mon"; - _M_day_a3 = "Tue"; - _M_day_a4 = "Wed"; - _M_day_a5 = "Thu"; - _M_day_a6 = "Fri"; - _M_day_a7 = "Sat"; + _M_data->_M_aday1 = "Sun"; + _M_data->_M_aday2 = "Mon"; + _M_data->_M_aday3 = "Tue"; + _M_data->_M_aday4 = "Wed"; + _M_data->_M_aday5 = "Thu"; + _M_data->_M_aday6 = "Fri"; + _M_data->_M_aday7 = "Sat"; // Month names, starting with "C"'s January. - _M_month01 = "January"; - _M_month02 = "February"; - _M_month03 = "March"; - _M_month04 = "April"; - _M_month05 = "May"; - _M_month06 = "June"; - _M_month07 = "July"; - _M_month08 = "August"; - _M_month09 = "September"; - _M_month10 = "October"; - _M_month11 = "November"; - _M_month12 = "December"; + _M_data->_M_month01 = "January"; + _M_data->_M_month02 = "February"; + _M_data->_M_month03 = "March"; + _M_data->_M_month04 = "April"; + _M_data->_M_month05 = "May"; + _M_data->_M_month06 = "June"; + _M_data->_M_month07 = "July"; + _M_data->_M_month08 = "August"; + _M_data->_M_month09 = "September"; + _M_data->_M_month10 = "October"; + _M_data->_M_month11 = "November"; + _M_data->_M_month12 = "December"; // Abbreviated month names, starting with "C"'s Jan. - _M_month_a01 = "Jan"; - _M_month_a02 = "Feb"; - _M_month_a03 = "Mar"; - _M_month_a04 = "Apr"; - _M_month_a05 = "May"; - _M_month_a06 = "Jun"; - _M_month_a07 = "July"; - _M_month_a08 = "Aug"; - _M_month_a09 = "Sep"; - _M_month_a10 = "Oct"; - _M_month_a11 = "Nov"; - _M_month_a12 = "Dec"; + _M_data->_M_amonth01 = "Jan"; + _M_data->_M_amonth02 = "Feb"; + _M_data->_M_amonth03 = "Mar"; + _M_data->_M_amonth04 = "Apr"; + _M_data->_M_amonth05 = "May"; + _M_data->_M_amonth06 = "Jun"; + _M_data->_M_amonth07 = "Jul"; + _M_data->_M_amonth08 = "Aug"; + _M_data->_M_amonth09 = "Sep"; + _M_data->_M_amonth10 = "Oct"; + _M_data->_M_amonth11 = "Nov"; + _M_data->_M_amonth12 = "Dec"; } -#ifdef _GLIBCPP_USE_WCHAR_T +#ifdef _GLIBCXX_USE_WCHAR_T template<> void __timepunct<wchar_t>:: @@ -131,62 +134,65 @@ namespace std void __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale) { - // "C" locale - _M_date_format = L"%m/%d/%y"; - _M_date_era_format = L"%m/%d/%y"; - _M_time_format = L"%H:%M:%S"; - _M_time_era_format = L"%H:%M:%S"; - _M_date_time_format = L""; - _M_date_time_era_format = L""; - _M_am = L"AM"; - _M_pm = L"PM"; - _M_am_pm_format = L""; + // "C" locale. + if (!_M_data) + _M_data = new __timepunct_cache<wchar_t>; + + _M_data->_M_date_format = L"%m/%d/%y"; + _M_data->_M_date_era_format = L"%m/%d/%y"; + _M_data->_M_time_format = L"%H:%M:%S"; + _M_data->_M_time_era_format = L"%H:%M:%S"; + _M_data->_M_date_time_format = L""; + _M_data->_M_date_time_era_format = L""; + _M_data->_M_am = L"AM"; + _M_data->_M_pm = L"PM"; + _M_data->_M_am_pm_format = L""; // Day names, starting with "C"'s Sunday. - _M_day1 = L"Sunday"; - _M_day2 = L"Monday"; - _M_day3 = L"Tuesday"; - _M_day4 = L"Wednesday"; - _M_day5 = L"Thursday"; - _M_day6 = L"Friday"; - _M_day7 = L"Saturday"; + _M_data->_M_day1 = L"Sunday"; + _M_data->_M_day2 = L"Monday"; + _M_data->_M_day3 = L"Tuesday"; + _M_data->_M_day4 = L"Wednesday"; + _M_data->_M_day5 = L"Thursday"; + _M_data->_M_day6 = L"Friday"; + _M_data->_M_day7 = L"Saturday"; // Abbreviated day names, starting with "C"'s Sun. - _M_day_a1 = L"Sun"; - _M_day_a2 = L"Mon"; - _M_day_a3 = L"Tue"; - _M_day_a4 = L"Wed"; - _M_day_a5 = L"Thu"; - _M_day_a6 = L"Fri"; - _M_day_a7 = L"Sat"; + _M_data->_M_aday1 = L"Sun"; + _M_data->_M_aday2 = L"Mon"; + _M_data->_M_aday3 = L"Tue"; + _M_data->_M_aday4 = L"Wed"; + _M_data->_M_aday5 = L"Thu"; + _M_data->_M_aday6 = L"Fri"; + _M_data->_M_aday7 = L"Sat"; // Month names, starting with "C"'s January. - _M_month01 = L"January"; - _M_month02 = L"February"; - _M_month03 = L"March"; - _M_month04 = L"April"; - _M_month05 = L"May"; - _M_month06 = L"June"; - _M_month07 = L"July"; - _M_month08 = L"August"; - _M_month09 = L"September"; - _M_month10 = L"October"; - _M_month11 = L"November"; - _M_month12 = L"December"; + _M_data->_M_month01 = L"January"; + _M_data->_M_month02 = L"February"; + _M_data->_M_month03 = L"March"; + _M_data->_M_month04 = L"April"; + _M_data->_M_month05 = L"May"; + _M_data->_M_month06 = L"June"; + _M_data->_M_month07 = L"July"; + _M_data->_M_month08 = L"August"; + _M_data->_M_month09 = L"September"; + _M_data->_M_month10 = L"October"; + _M_data->_M_month11 = L"November"; + _M_data->_M_month12 = L"December"; // Abbreviated month names, starting with "C"'s Jan. - _M_month_a01 = L"Jan"; - _M_month_a02 = L"Feb"; - _M_month_a03 = L"Mar"; - _M_month_a04 = L"Apr"; - _M_month_a05 = L"May"; - _M_month_a06 = L"Jun"; - _M_month_a07 = L"July"; - _M_month_a08 = L"Aug"; - _M_month_a09 = L"Sep"; - _M_month_a10 = L"Oct"; - _M_month_a11 = L"Nov"; - _M_month_a12 = L"Dec"; + _M_data->_M_amonth01 = L"Jan"; + _M_data->_M_amonth02 = L"Feb"; + _M_data->_M_amonth03 = L"Mar"; + _M_data->_M_amonth04 = L"Apr"; + _M_data->_M_amonth05 = L"May"; + _M_data->_M_amonth06 = L"Jun"; + _M_data->_M_amonth07 = L"Jul"; + _M_data->_M_amonth08 = L"Aug"; + _M_data->_M_amonth09 = L"Sep"; + _M_data->_M_amonth10 = L"Oct"; + _M_data->_M_amonth11 = L"Nov"; + _M_data->_M_amonth12 = L"Dec"; } #endif } |