]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR modula2/110779 SysClock can not read the clock (Darwin portability fixes)
authorGaius Mulley <gaiusmod2@gmail.com>
Sat, 12 Aug 2023 17:17:41 +0000 (18:17 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Sat, 12 Aug 2023 17:17:41 +0000 (18:17 +0100)
commit63fb0bedb8077ac1e6b6337f198b4eae30813fbc
tree5a66a3f4f6f25ab7d12256efaa1afe1d2be13b13
parent46905fcde00fd84eb06b6bd1a6e788171d32865b
PR modula2/110779 SysClock can not read the clock (Darwin portability fixes)

This patch adds corrections to defensively check against glibc functions,
structures and contains fallbacks.  These fixes were required under Darwin.

gcc/m2/ChangeLog:

PR modula2/110779
* gm2-libs-iso/SysClock.mod (EpochTime): New procedure.
(GetClock): Call EpochTime if the C time functions are
unavailable.
* gm2-libs-iso/wrapclock.def (istimezone): New function
definition.

libgm2/ChangeLog:

PR modula2/110779
* configure: Regenerate.
* configure.ac: Provide special case test for Darwin cross
configuration.
(GLIBCXX_CONFIGURE): New statement.
(GLIBCXX_CHECK_GETTIMEOFDAY): New statement.
(GLIBCXX_ENABLE_LIBSTDCXX_TIME): New statement.
* libm2iso/wrapclock.cc: New sys/time.h conditional include.
(sys/syscall.h): Conditional include.
(unistd.h): Conditional include.
(GetTimeRealtime): Re-implement.
(SetTimeRealtime): Re-implement.
(timezone): Re-implement.
(istimezone): New function.
(daylight): Re-implement.
(isdst): Re-implement.
(tzname): Re-implement.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-libs-iso/SysClock.mod
gcc/m2/gm2-libs-iso/wrapclock.def
libgm2/configure
libgm2/configure.ac
libgm2/libm2iso/wrapclock.cc