@Andrew and @Colin, thank you.

> the __LIBREL__ and __TARGET_LIB__ macros

Agreed, that's a better approach. After I wrote my OP I recalled I had used the 
latter macro a while ago to solve a similar problem. It's better than a unique 
macro because (a.) it is only one thing to change in the options file and (b.) 
it is more or less self-documenting. (And (c.), it actually works!)

> DEF (Y2038_LEV2R3=)     is correct syntax, but maybe there is a bug.

Yeah, that was kind of my conclusion. I quit blaming my program errors on 
compiler bugs about forty years ago, but in this case it may be true. In any 
event the syntax is not intuitive. DEF (macro) is equivalent to #define macro 1 
and DEF (macro=) is equivalent to #define macro. I think I am going to use 
__TARGET_LIB__ per the above, and I don't think I have the ambition to try and 
figure out whether there is a compiler bug with DEF, especially since IBM 
probably doesn't care now that there is a whole new C/C++ compiler.

> the ftime() function and timeb structure are deprecated

Well yeah, that's the point of this whole exercise. And deprecated or not, they 
will quit working correctly in less than 13 years. The thing is I have somewhat 
complex, existing, working code that uses ftime64() and timeb64, I need the 
millisecond value that time64() does not provide, and I really don't want to 
re-write the logic and re-debug it. Much of the Y2038 support came along as 
early as z/OS V1R11, but ftime64() does not appear until V2R3. 

Charles

On Sun, 26 Jan 2025 02:51:07 -0600, Andrew Mattingly <[email protected]> 
wrote:

>I would draw your attention to the __LIBREL__ and __TARGET_LIB__ macros 
>(https://www.ibm.com/docs/en/zos/3.1.0?topic=cpm-general-macros) and the 
>__librel() library function 
>(https://www.ibm.com/docs/en/zos/3.1.0?topic=reference-library-functions).  It 
>might be better to use one of these, depending on the effect you want to 
>achieve.
>
>I would also note that the ftime() function and timeb structure are 
>deprecated.  You are better off using time64(), which has been available since 
>z/OS 2.1 (or possibly earlier), then you wouldn't need to test the operating 
>system/library level.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to