Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lyVmk-0001hs-PV for mharc-grub-devel@gnu.org; Wed, 30 Jun 2021 04:41:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyVmi-0001aw-La for grub-devel@gnu.org; Wed, 30 Jun 2021 04:41:28 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:36643) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyVmg-0003wt-Pg for grub-devel@gnu.org; Wed, 30 Jun 2021 04:41:28 -0400 Received: by mail-pg1-x52c.google.com with SMTP id e33so1570957pgm.3 for ; Wed, 30 Jun 2021 01:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TNSxpVPRbbCRcreBItoVWaxU2zcFtaFmtoF02nQrgfc=; b=XYDs6jCqtLkPd3JZJxekOlL/bZoOiCSgX0JZ/whJ89PArfyJ0gDuTvu1gRibs78h9W 7HalUQ7UPmIttjOrmvAQvi9PLEaJWytCvuGbutpWtTcNj+9RPVNpHJhSRYw8LpDp96p9 7ykifx67NCYiWGxAqTaw6nbjljk+Lkh2Qde+A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TNSxpVPRbbCRcreBItoVWaxU2zcFtaFmtoF02nQrgfc=; b=YN0m701hBTLK05jpvQ7KUy9tP7TWBJsH5F7ymaAikrFfdQQGr7MNupgNmgALic1TbG UGDMaguSYAANDTi3MyvBoJrDos2mG6PrARNc9ZPxcBCPfClsbNVlOTiQpPoq8PVzPmDI 3s1HUDBGXLWF5dH2W8bh4WtI8yJjQShAkxeqKvkwGujeo5U7riBqSlD+mGafx6aBUhrJ SivfSs0np8fV9rDIBGiJEmwd4BTeYBC8rx7iKSMFs7bm+OuVEQrXePRATRVEJoghdp1z 2LxCbX/THqKxaMYG49rK7WTfT26KCh6R8yuipjrtDKwtsTQy+VK5+A/fn401MBYoWWhL CTRQ== X-Gm-Message-State: AOAM531IdMQaKIm5gC5pXPB2iYx9eQUb6d/m1SKvWLD1lEXjua/Vh4HL CprcHIuyapQK30Mkzqki9PN5L94xfxbNAQ== X-Google-Smtp-Source: ABdhPJzW8dLPBA4r6CJiuXp6ahOXqcDfvhQs+bVSpz7bxQe+9xtKtKQfwTxlCEqnwTO15oAvfZBtYg== X-Received: by 2002:a05:6a00:1993:b029:30a:b043:b27a with SMTP id d19-20020a056a001993b029030ab043b27amr21148614pfl.4.1625042485372; Wed, 30 Jun 2021 01:41:25 -0700 (PDT) Received: from localhost ([203.206.29.204]) by smtp.gmail.com with ESMTPSA id ay3sm12591537pjb.38.2021.06.30.01.41.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 01:41:25 -0700 (PDT) From: Daniel Axtens To: grub-devel@gnu.org Cc: rashmica.g@gmail.com, alastair@d-silva.org, nayna@linux.ibm.com, Daniel Axtens Subject: [PATCH v2 10/22] posix_wrap: tweaks in preparation for libtasn1 Date: Wed, 30 Jun 2021 18:40:19 +1000 Message-Id: <20210630084031.2663622-11-dja@axtens.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210630084031.2663622-1-dja@axtens.net> References: <20210630084031.2663622-1-dja@axtens.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=dja@axtens.net; helo=mail-pg1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jun 2021 08:41:29 -0000 - Define SIZEOF_UNSIGNED_LONG_INT, it's the same as SIZEOF_UNSIGNED_LONG. - Define WORD_BIT, the size in bits of an int. This is a defined in the Single Unix Specification and in gnulib's limits.h. gnulib assumes it's 32 bits on all our platforms, including 64 bit platforms, so we also use that value. - Provide strto[u]l[l] preprocessor macros that resolve to grub_strto[u]l[l]. To avoid gcrypt redefining strtoul, we also define HAVE_STRTOUL here. Signed-off-by: Daniel Axtens --- grub-core/lib/posix_wrap/limits.h | 1 + grub-core/lib/posix_wrap/stdlib.h | 8 ++++++++ grub-core/lib/posix_wrap/sys/types.h | 1 + 3 files changed, 10 insertions(+) diff --git a/grub-core/lib/posix_wrap/limits.h b/grub-core/lib/posix_wrap/limits.h index 7217138ffd6b..591dbf3289d8 100644 --- a/grub-core/lib/posix_wrap/limits.h +++ b/grub-core/lib/posix_wrap/limits.h @@ -37,5 +37,6 @@ #define LONG_MAX GRUB_LONG_MAX #define CHAR_BIT 8 +#define WORD_BIT 32 #endif diff --git a/grub-core/lib/posix_wrap/stdlib.h b/grub-core/lib/posix_wrap/stdlib.h index 7a8d385e973a..4634db09f294 100644 --- a/grub-core/lib/posix_wrap/stdlib.h +++ b/grub-core/lib/posix_wrap/stdlib.h @@ -58,4 +58,12 @@ abs (int c) return (c >= 0) ? c : -c; } +#define strtol grub_strtol + +/* for libgcrypt */ +#define HAVE_STRTOUL +#define strtoul grub_strtoul + +#define strtoull grub_strtoull + #endif diff --git a/grub-core/lib/posix_wrap/sys/types.h b/grub-core/lib/posix_wrap/sys/types.h index 854eb0122efa..f63412c8da06 100644 --- a/grub-core/lib/posix_wrap/sys/types.h +++ b/grub-core/lib/posix_wrap/sys/types.h @@ -51,6 +51,7 @@ typedef grub_uint8_t byte; typedef grub_addr_t uintptr_t; #define SIZEOF_UNSIGNED_LONG GRUB_CPU_SIZEOF_LONG +#define SIZEOF_UNSIGNED_LONG_INT GRUB_CPU_SIZEOF_LONG #define SIZEOF_UNSIGNED_INT 4 #define SIZEOF_UNSIGNED_LONG_LONG 8 #define SIZEOF_UNSIGNED_SHORT 2 -- 2.30.2