Modify

Ticket #4475 (closed Patches: fixed)

Opened 4 years ago

Last modified 3 years ago

OpenVMS patch for 64 bit support

Reported by: artyomtnk@… Owned by: az_sw_dude
Milestone: Boost 1.44.0 Component: date_time
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:

Description

Hello,

This patch provides 64 bit fixes for OpenVMS platform.

It is very important for the organization I work for to submit them to upstream Boost in order to make an upgrade to future Boost versions simpler.

This patch related to ticket: #4473

Thanks,

Artyom

Attachments

date_time.patch Download (1.3 KB) - added by artyomtnk@… 4 years ago.

Change History

Changed 4 years ago by artyomtnk@…

comment:1 Changed 3 years ago by Rob Stewart

You propose the following structure:

#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64 
   std::tm tmp; 
   if(!localtime_r(t,&tmp)) 
      result = 0; 
   else 
      *result = tmp;       
#else 
   result = localtime_r(t, result); 
#endif

Why not this instead? That is, why is tmp needed?

#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64 
   if (!localtime_r(t, result)) 
      result = 0; 
#else 
   result = localtime_r(t, result); 
#endif

comment:2 Changed 3 years ago by artyomtnk@…

The problem is that VMS allows mixed 32 and 64 bit pointers (something like DOS's near/far) and some system functions - in this case localetime_r, accept only 32 bit pointers while most accept both type of pointer.

What happens is that I need to pass 32 bit pointer to the function to make sure it works. Result is 64 bit pointer so I can't pass it as is. So I create a local variable tmp that is placed on stack. And it is promised that stack is always placed in 32bit region so I can relate on the fact that the pointer would be 32bit pointer.

And after I get the result I can copy it to the location of 64 bit pointer.

This is quite ugly but that is how OpenVMS works.

Thanks,

Artyom

comment:3 Changed 3 years ago by marshall

(In [70767]) Applied patch - Refs #4475

comment:4 Changed 3 years ago by marshall

  • Status changed from new to closed
  • Resolution set to fixed

(In [70982]) Merge date/time fixes to release. Fixes #4475

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.