From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27232 invoked from network); 31 May 2023 09:24:52 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 31 May 2023 09:24:52 -0000 Received: (qmail 1368 invoked by uid 550); 31 May 2023 09:23:37 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 32617 invoked from network); 31 May 2023 09:23:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=CmCoe9Ujdgs5MDbQ7cJtm5tGbe/v85zSD+G9CkUg0tY=; b=uz99bqQzePYKcUxJ+cvA2n59MR+/lcxEkUP947sIlxOWBMzmDzmV9PCs pGQGi2bRddTcsR9Z3H5U0PxqZR78QmjuHY95ajUO3b5wl4Xv/jrsX5zHe p5fzh+pnfdFkjFr2eoyEz7cNNfB5dHSh7/e6sMhhuYIhI4Fsgisaf4F8l o=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=Jens.Gustedt@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.00,205,1681164000"; d="scan'208";a="57428734" From: Jens Gustedt To: musl@lists.openwall.com Date: Wed, 31 May 2023 11:22:50 +0200 Message-Id: <65deacef8e879e0278ca6bcfd0d7c0a4fd7387a7.1685522953.git.Jens.Gustedt@inria.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [musl] [C23 divers headers 03/17] C23: add call_once to stdlib.h Since C23, call_once, once_flag and ONCE_FLAG_INIT are also accessible even if the platform does not have the threads option. Add them to the header. The identifiers once_flag and ONCE_FLAG_INIT were not reserved in C17 if the header threads.h was not included, so we protect this with the version macro. --- include/stdlib.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/stdlib.h b/include/stdlib.h index 475190bf..0e66f84a 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -172,6 +172,12 @@ long double strtold_l(const char *__restrict, char **__restrict, struct __locale #endif #endif +#if __STDC_VERSION__ >= 202000L +#define ONCE_FLAG_INIT 0 +typedef int once_flag; +void call_once(once_flag *, void (*)(void)); +#endif + #ifdef __cplusplus } #endif -- 2.34.1