From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 50E20159C9B for ; Tue, 6 Aug 2024 08:47:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6EDE42BC04D; Tue, 6 Aug 2024 08:47:18 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 573112BC04D for ; Tue, 6 Aug 2024 08:47:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 65D86342FF7 for ; Tue, 6 Aug 2024 08:47:17 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5837A1EB8 for ; Tue, 6 Aug 2024 08:47:15 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1722932941.9c0708dcae5ef0792e2273968f6f6ff45d90b11f.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/toolchain-funcs.eclass X-VCS-Directories: eclass/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 9c0708dcae5ef0792e2273968f6f6ff45d90b11f X-VCS-Branch: master Date: Tue, 6 Aug 2024 08:47:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 8d61d74d-36b9-439e-9083-43684ba92ca2 X-Archives-Hash: 49d7ee9d84ba90adf57da6bea0631c75 commit: 9c0708dcae5ef0792e2273968f6f6ff45d90b11f Author: Michał Górny gentoo org> AuthorDate: Thu Jun 13 15:17:07 2024 +0000 Commit: Michał Górny gentoo org> CommitDate: Tue Aug 6 08:29:01 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c0708dc toolchain-funcs.eclass: Add tc-has-64bit-time_t Add a helper function to check whether time_t is 64-bit. This could be used e.g. to deselect tests that rely on timestamps exceeding Y2k38. It is meant to be more future-proof than hardcoding a list of 32-bit architectures, given the necessity of switching to 64-bit time_t in the future. Signed-off-by: Michał Górny gentoo.org> eclass/toolchain-funcs.eclass | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index e73af9772938..9f0953c079e3 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -1,4 +1,4 @@ -# Copyright 2002-2023 Gentoo Authors +# Copyright 2002-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: toolchain-funcs.eclass @@ -1253,4 +1253,14 @@ tc-is-lto() { return "${ret}" } +# @FUNCTION: tc-has-64bit-time_t +# @RETURN: Shell true if time_t is at least 64 bits long, false otherwise +tc-has-64bit-time_t() { + $(tc-getCC) ${CFLAGS} ${CPPFLAGS} -c -x c - -o /dev/null <<-EOF &>/dev/null + #include + int test[sizeof(time_t) >= 8 ? 1 : -1]; + EOF + return $? +} + fi