You might try DEF (Y2038_LEV2R3) or DEF (Y2038_LEV2R3=1) instead of DEF (Y2038_LEV2R3=). DEF (Y2038_LEV2R3=) is correct syntax, but maybe there is a bug.
Colin On Sat, 25 Jan 2025 at 19:44, Charles Mills <charl...@mcn.org> wrote: > IBM "Classic" XLC C++ V2R5 > > The fundamental problem I am trying to solve is creating bi-modal source > code that will support UNIX dates beyond 2038; or alternatively will build > under z/OS V2R2. > > I have the usual sort of #if/#else/#endif structure based on a macro named > Y2038_LEV2R3. I want to set the macro in an options file because that is > where the LE version is set, so I can group the two things together, > something like > > DEF (Y2038_LEV2R3=) > TARG(LE,zOSV2R3) > > Questions: > > 1. I'm kind of nervous -- deservedly it turns out -- whether the macro > logic is working as intended. Is there a way to put a compile time message > into the code? I would like something that worked like #error but that > generated an informational message rather than an error. I would even > settle for a warning. I don't see anything like that. Am I missing > something? > > 2. It turns out the macro logic is *not* working. I have the lines above > in an options file (which I know is being processed) and the following C++ > code: > #ifdef Y2038_LEV2R3 > // Y2038 and LEV2R3+ > timeb64 now, timesup; > ftime64(&now); > #else > // No Y2038 and LEV2R1+ > #error Y2038_LEVR2R3 not happening! > timeb now, timesup; > ftime(&now); > #endif > > and sure enough, the error message is being output by the compiler. > CCN5859 (S) #error directive: Y2038_LEVR2R3 not happening!. > > What am I doing wrong? > > Thanks, > Charles > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN