Index: date_time/gregorian/greg_facet.hpp =================================================================== --- date_time/gregorian/greg_facet.hpp (revision 91) +++ date_time/gregorian/greg_facet.hpp (working copy) @@ -8,7 +8,8 @@ * Author: Jeff Garland, Bart Garst * $Date: 2008-11-23 03:13:35 -0800 (Sun, 23 Nov 2008) $ */ - +#define BOOST_NO_EXCEPTIONS +#include "boost/detail/no_exceptions_support.hpp" #include "boost/date_time/gregorian/gregorian_types.hpp" #include "boost/date_time/date_formatting_locales.hpp" // sets BOOST_DATE_TIME_NO_LOCALE #include "boost/date_time/gregorian/parsers.hpp" @@ -280,7 +281,7 @@ short num = 0; - try{ + BOOST_TRY { const facet_def& f = std::use_facet(is.getloc()); num = date_time::find_match(f.get_short_month_names(), f.get_long_month_names(), @@ -290,7 +291,7 @@ /* bad_cast will be thrown if the desired facet is not accessible * so we can generate the facet. This has the drawback of using english * names as a default. */ - catch(std::bad_cast&){ + BOOST_CATCH (std::bad_cast&){ charT a = '\0'; std::auto_ptr< const facet_def > f(create_facet_def(a)); num = date_time::find_match(f->get_short_month_names(), @@ -298,6 +299,7 @@ (greg_month::max)(), s); // greg_month spans 1..12, so max returns the array size, // which is needed by find_match } + BOOST_CATCH_END ++num; // months numbered 1-12 m = greg_month(num); @@ -322,7 +324,7 @@ } short num = 0; - try{ + BOOST_TRY{ const facet_def& f = std::use_facet(is.getloc()); num = date_time::find_match(f.get_short_weekday_names(), f.get_long_weekday_names(), @@ -332,7 +334,7 @@ /* bad_cast will be thrown if the desired facet is not accessible * so we can generate the facet. This has the drawback of using english * names as a default. */ - catch(std::bad_cast&){ + BOOST_CATCH (std::bad_cast&){ charT a = '\0'; std::auto_ptr< const facet_def > f(create_facet_def(a)); num = date_time::find_match(f->get_short_weekday_names(), @@ -340,6 +342,7 @@ (greg_weekday::max)() + 1, s); // greg_weekday spans 0..6, so increment is needed // to form the array size which is needed by find_match } + BOOST_CATCH_END wd = greg_weekday(num); // weekdays numbered 0-6 return is;