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 27131 invoked from network); 31 May 2023 09:24:15 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 31 May 2023 09:24:15 -0000 Received: (qmail 1273 invoked by uid 550); 31 May 2023 09:23:36 -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 32568 invoked from network); 31 May 2023 09:23:30 -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=C6s9MSUd/ObPg2zK0AvmR5JmdrQO0/952tQSQQPZDWQ=; b=RFeShkBktSupUAkLR+F6NfCOjMCiFux1W+0RrKfQefP1FErB3rg29UaN /7EcFyOAxrusTSCAq+Hd42EIvBDhbmXL+Jxu792thV8jetIDD5I9L3mhS u+rTTVBMRk+Fai8Fab8SBLoyEsQjCPwC2Vb9isaprs5NU1IaMria/v7fj U=; 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="57428730" From: Jens Gustedt To: musl@lists.openwall.com Date: Wed, 31 May 2023 11:22:48 +0200 Message-Id: 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 01/17] C23: add the WIDTH macros for the standard integer types These have not previously reserved, nevertheless we define them without feature macro. This is because these are now the fundamental definitions for standard integer types, basically all other features of standard integer types can now be derived from them. We could later add a cleanup patch, that would exactly do that: provide the width of all integer types and then derive MIN and MAX macros systematically from that. --- include/limits.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/limits.h b/include/limits.h index 53a27b9d..476f4891 100644 --- a/include/limits.h +++ b/include/limits.h @@ -5,6 +5,24 @@ #include /* __LONG_MAX */ +#define BOOL_WIDTH 1 +#define CHAR_WIDTH 8 +#define UCHAR_WIDTH 8 +#define SCHAR_WIDTH 8 +#define USHRT_WIDTH 16 +#define SHRT_WIDTH 16 +#define UINT_WIDTH 32 +#define INT_WIDTH 32 +#define ULLONG_WIDTH 64 +#define LLONG_WIDTH 64 +#if __LONG_MAX == 0x7fffffff +#define ULONG_WIDTH 32 +#define LONG_WIDTH 32 +#else +#define ULONG_WIDTH 64 +#define LONG_WIDTH 64 +#endif + /* Support signed or unsigned plain-char */ #if '\xff' > 0 -- 2.34.1