diff --git b/libs/locale/src/std/codecvt.cpp a/libs/locale/src/std/codecvt.cpp index 513d22f..8ea00aa 100644 --- b/libs/locale/src/std/codecvt.cpp +++ a/libs/locale/src/std/codecvt.cpp @@ -18,7 +18,7 @@ namespace impl_std { std::locale codecvt_bychar( std::locale const &in, std::string const &locale_name) { - return std::locale(in,new std::codecvt_byname(locale_name.c_str())); + return std::locale(in,new std::codecvt_byname(locale_name.c_str())); } diff --git b/libs/locale/src/util/codecvt_converter.cpp a/libs/locale/src/util/codecvt_converter.cpp index 7a9aab2..8c7e25c 100644 --- b/libs/locale/src/util/codecvt_converter.cpp +++ a/libs/locale/src/util/codecvt_converter.cpp @@ -70,7 +70,7 @@ namespace util { if(!utf::is_valid_codepoint(u)) return illegal; int width = utf::utf_traits::width(u); - ptrdiff_t d=end-begin; + std::ptrdiff_t d=end-begin; if(d < width) return incomplete; utf::utf_traits::encode(u,begin); @@ -229,11 +229,11 @@ namespace util { // Real codecvt template - class code_converter : public std::codecvt + class code_converter : public std::codecvt { public: code_converter(std::auto_ptr cvt,size_t refs = 0) : - std::codecvt(refs), + std::codecvt(refs), cvt_(cvt) { max_len_ = cvt_->max_len(); @@ -627,14 +627,14 @@ namespace util { }; - static const char ensure_mbstate_size_is_at_least_2[sizeof(mbstate_t) >= 2 ? 1 : -1] = {0}; + static const char ensure_mbstate_size_is_at_least_2[sizeof(std::mbstate_t) >= 2 ? 1 : -1] = {0}; template<> - class code_converter : public std::codecvt + class code_converter : public std::codecvt { public: code_converter(std::auto_ptr /*cvt*/,size_t refs = 0) : - std::codecvt(refs) + std::codecvt(refs) { } }; diff --git b/libs/locale/src/util/gregorian.cpp a/libs/locale/src/util/gregorian.cpp index 4c7a8c1..9a99cab 100644 --- b/libs/locale/src/util/gregorian.cpp +++ a/libs/locale/src/util/gregorian.cpp @@ -70,7 +70,7 @@ namespace util { return days[is_leap(year)][month-1] + day - 1; } - time_t internal_timegm(std::tm const *t) + std::time_t internal_timegm(std::tm const *t) { int year = t->tm_year + 1900; int month = t->tm_mon; @@ -88,8 +88,8 @@ namespace util { int day_of_year = days_from_1jan(year,month,day); int days_since_epoch = days_from_1970(year) + day_of_year; - time_t seconds_in_day = 3600 * 24; - time_t result = seconds_in_day * days_since_epoch + 3600 * t->tm_hour + 60 * t->tm_min + t->tm_sec; + std::time_t seconds_in_day = 3600 * 24; + std::time_t result = seconds_in_day * days_since_epoch + 3600 * t->tm_hour + 60 * t->tm_min + t->tm_sec; return result; } @@ -235,10 +235,10 @@ namespace util { std::tm val = tm_updated_; val.tm_isdst = -1; val.tm_wday = -1; // indecator of error - time_t point = -1; + std::time_t point = -1; if(is_local_) { point = mktime(&val); - if(point == static_cast(-1)){ + if(point == static_cast(-1)){ #ifndef BOOST_WINDOWS // windows does not handle negative time_t, under other plaforms // it may be actually valid value in 1969-12-31 23:59:59 @@ -318,7 +318,7 @@ namespace util { #ifdef BOOST_WINDOWS return 1970; // Unix epoch windows can't handle negative time_t #else - if(sizeof(time_t) == 4) + if(sizeof(std::time_t) == 4) return 1901; // minimal year with 32 bit time_t else return 1; @@ -326,7 +326,7 @@ namespace util { case absolute_maximum: case least_maximum: case actual_maximum: - if(sizeof(time_t) == 4) + if(sizeof(std::time_t) == 4) return 2038; // Y2K38 - maximal with 32 bit time_t else return std::numeric_limits::max(); @@ -565,7 +565,7 @@ namespace util { /// virtual void set_time(posix_time const &p) { - from_time(static_cast(p.seconds)); + from_time(static_cast(p.seconds)); } virtual posix_time get_time() const { @@ -791,9 +791,9 @@ namespace util { private: - void from_time(time_t point) + void from_time(std::time_t point) { - time_t real_point = point + tzoff_; + std::time_t real_point = point + tzoff_; std::tm *t = 0; #ifdef BOOST_WINDOWS // Windows uses TLS, thread safe @@ -811,7 +811,7 @@ namespace util { time_ = point; } int first_day_of_week_; - time_t time_; + std::time_t time_; std::tm tm_; std::tm tm_updated_; bool normalized_; diff --git b/libs/locale/src/util/numeric.hpp a/libs/locale/src/util/numeric.hpp index 3155dbc..ee5bb51 100644 --- b/libs/locale/src/util/numeric.hpp +++ a/libs/locale/src/util/numeric.hpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "timezone.hpp" @@ -177,7 +178,7 @@ private: return out; } - iter_type format_time(iter_type out,std::ios_base &ios,char_type fill,time_t time,char c) const + iter_type format_time(iter_type out,std::ios_base &ios,char_type fill,std::time_t time,char c) const { string_type fmt; fmt+=char_type('%'); @@ -185,7 +186,7 @@ private: return format_time(out,ios,fill,time,fmt); } - iter_type format_time(iter_type out,std::ios_base &ios,char_type fill,time_t time,string_type const &format) const + iter_type format_time(iter_type out,std::ios_base &ios,char_type fill,std::time_t time,string_type const &format) const { std::string tz = ios_info::get(ios).time_zone(); std::tm tm;