]> git.ipfire.org Git - thirdparty/gcc.git/commit
cobol: Guard clock_gettime(). [PR119975]
authorRobert Dubner <rdubner@symas.com>
Thu, 5 Jun 2025 14:53:02 +0000 (10:53 -0400)
committerRobert Dubner <rdubner@symas.com>
Thu, 5 Jun 2025 16:30:55 +0000 (12:30 -0400)
commit2e334900f4ddcd804e3b324402544a572d306ab6
tree05c50449eccd5c0713e98184aa53d15e17590a5e
parent58fb3ba1969b6c21abce9b1da06dcb6c2b638c9d
cobol: Guard clock_gettime(). [PR119975]

This attempts to eliminate "'clock_gettime' not declared..." when
building on x86_64-apple-darwin15.6.0.  Calls to clock_gettime have been
reduced to two locations.  Both have been guarded with

gcc/cobol/ChangeLog:

PR cobol/119975
* genapi.cc (parser_intrinsic_call_0): Use get_time_nanoseconds().
* genutil.cc (get_time_64): Rename to get_time_nanoseconds().
(get_time_nanoseconds): Likewise.
* genutil.h (get_time_64): Likewise.
(get_time_nanoseconds): Likewise.
* util.cc (class cbl_timespec): Timing routine uses
get_time_nanoseconds().
(operator-): Likewise.
(parse_file): Likewise.

libgcobol/ChangeLog:

PR cobol/119975
* configure.ac: AC_CHECK_LIB(rt, clock_gettime).
* config.h.in: Likewise.
* configure: Likewise.
* gfileio.cc: Remove in-line cppcheck-suppress.
* intrinsic.cc (timespec_to_string): Use guarded clock_gettime().
(__gg__current_date): Likewise.
(__gg__seconds_past_midnight): Likewise.
(__gg__formatted_current_date): Likewise.
(__gg__random): Likewise.
(__gg__random_next): Likewise.
(__gg__when_compiled): Likewise.
* libgcobol.cc (cobol_time): Likewise.
(get_time_nanoseconds): Likewise.
(__gg__clock_gettime): Likewise.
(__gg__get_date_hhmmssff): Likewise.
* libgcobol.h (__gg__clock_gettime): Likewise.
(struct cbl_timespec): Likewise.
gcc/cobol/genapi.cc
gcc/cobol/genutil.cc
gcc/cobol/genutil.h
gcc/cobol/util.cc
libgcobol/config.h.in
libgcobol/configure
libgcobol/configure.ac
libgcobol/gfileio.cc
libgcobol/intrinsic.cc
libgcobol/libgcobol.cc
libgcobol/libgcobol.h