The declaration of time_t is in flux based on it's overflow in Year
2038, so declare it uniformly based on System.Parameter.time_t_bits
to ease this transition and also enable VxWorks targets which allow
it to be parameterized, to be rebuilt more easily by one source change.

Two changes of note:
s-linux__x32.ads also changes the size of suseconds_t and the field
tv_nsec in timespec to be 64 bits. Since it's a one of, it's not
handled via System.Parameters.

s-os_lib.ads contains a subtype time_t formerly of Long_Integer, changed
to Long_Long_Integer. This declaration is not used in the runtime, but
is available to application code via the renaming g-os_lib.ads. This
may cause some customer code to not compile, but is easily fixed by a
source code change. The alternative is to have two versions of
s-os_lib.ads, identical except for this subtype declaration.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * Makefile.rtl: Add translations for s-parame__posix2008.ads
        * libgnarl/s-linux.ads: Import System.Parameters.
        (time_t): Declare using System.Parameters.time_t_bits.
        * libgnarl/s-linux__alpha.ads: Likewise.
        * libgnarl/s-linux__android.ads: Likewise.
        * libgnarl/s-linux__hppa.ads: Likewise.
        * libgnarl/s-linux__mips.ads: Likewise.
        * libgnarl/s-linux__riscv.ads: Likewise.
        * libgnarl/s-linux__sparc.ads: Likewise.
        * libgnarl/s-linux__x32.ads: Likewise.
        * libgnarl/s-qnx.ads: Likewise.
        * libgnarl/s-osinte__aix.ads: Likewise.
        * libgnarl/s-osinte__android.ads: Likewise.
        * libgnarl/s-osinte__darwin.ads: Likewise.
        * libgnarl/s-osinte__dragonfly.ads: Likewise.
        * libgnarl/s-osinte__freebsd.ads: Likewise.
        * libgnarl/s-osinte__gnu.ads: Likewise.
        * libgnarl/s-osinte__hpux-dce.ads: Likewise.
        * libgnarl/s-osinte__hpux.ads: Likewise.
        * libgnarl/s-osinte__kfreebsd-gnu.ads: Likewise.
        * libgnarl/s-osinte__lynxos178e.ads: Likewise.
        * libgnarl/s-osinte__qnx.ads: Likewise.
        * libgnarl/s-osinte__rtems.ads: Likewise.
        * libgnarl/s-osinte__solaris.ads: Likewise.
        * libgnarl/s-osinte__vxworks.ads: Likewise.
        * libgnat/g-sothco.ads: Likewise.
        * libgnat/s-osprim__darwin.adb: Likewise.
        * libgnat/s-osprim__posix.adb: Likewise.
        * libgnat/s-osprim__posix2008.adb: Likewise.
        * libgnat/s-osprim__rtems.adb: Likewise.
        * libgnat/s-osprim__x32.adb: Likewise.
        * libgnarl/s-osinte__linux.ads: use type System.Linux.time_t.
        * libgnat/s-os_lib.ads (time_t): Declare as subtype of
        Long_Long_Integer.
        * libgnat/s-parame.ads (time_t_bits): New constant.
        * libgnat/s-parame__ae653.ads (time_t_bits): Likewise.
        * libgnat/s-parame__hpux.ads (time_t_bits): Likewise.
        * libgnat/s-parame__vxworks.ads (time_t_bits): Likewise.
        * libgnat/s-parame__posix2008.ads: New file for 64 bit time_t.

Attachment: patch.diff.gz
Description: application/gzip

Reply via email to