Ticket #4475: date_time.patch

File date_time.patch, 1.3 KB (added by artyomtnk@…, 12 years ago)
  • boost/date_time/c_time.hpp

    diff -rupN boost_1_43_0/boost/date_time/c_time.hpp boost_vms_1_43_0/boost/date_time/c_time.hpp
    old new namespace date_time {  
    5757      static std::tm* localtime(const std::time_t* t, std::tm* result)
    5858      {
    5959        // localtime_r() not in namespace std???
     60        #if defined(__VMS) && __INITIAL_POINTER_SIZE == 64
     61        std::tm tmp;
     62        if(!localtime_r(t,&tmp))
     63            result = 0;
     64        else
     65            *result = tmp;     
     66        #else
    6067        result = localtime_r(t, result);
     68        #endif
    6169        if (!result)
    6270          boost::throw_exception(std::runtime_error("could not convert calendar time to local time"));
    6371        return result;
    namespace date_time {  
    6775      static std::tm* gmtime(const std::time_t* t, std::tm* result)
    6876      {
    6977        // gmtime_r() not in namespace std???
     78        #if defined(__VMS) && __INITIAL_POINTER_SIZE == 64
     79        std::tm tmp;
     80        if(!gmtime_r(t,&tmp))
     81          result = 0;
     82        else
     83          *result = tmp;       
     84        #else
    7085        result = gmtime_r(t, result);
     86        #endif
    7187        if (!result)
    7288          boost::throw_exception(std::runtime_error("could not convert calendar time to UTC time"));
    7389        return result;