Let me reply here and close the loop on this.

On Tue, 28 Jan 2025 23:11:20 -0800, Retired Mainframer 
<retired-mainfra...@q.com> wrote:

>Can you use a #pragma to change the errors produced by #error into warnings?

That's a great idea! I may try that.

>Does it make a difference if you remove the = from the DEF statement

As I said earlier, I don't think I have the patience to try to solve an 
apparent IBM bug.

Here is what I did do. The suggestion of controlling the code based on 
__TARGET_LIB__ worked perfectly. I added

#define IS64BITTIME __TARGET_LIB__ >= 0x42030000

to a common header and then in the code I could write

#if IS64BITTIME
etc.

The client was not happy with my solution. They wanted V2R2 *and* Y2038 in a 
single build. So I took a further look at the code. 

gettimeofday64() turns out to be pretty much a 1:1 replacement for ftime64() 
and is available in V2R2. Obviously converting microseconds to milliseconds is 
trivial. There are two small issues with gettimeofday64(). It seems to be 
mis-documented in the IBM C library manual: the declaration is in <sys/time.h> 
not <time.h>, which is no big deal, but it took a little sleuthing to figure it 
out. And also I edit, syntax check and sometimes alpha test my code on Windows, 
and for some reason, the geniuses of Redmond decided not to include it in the 
Windows API, thereby complicating my usage.

But all is well. Thanks everyone for your help.

Charles

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to