Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lRF2g-0001Fm-O0 for mharc-grub-devel@gnu.org; Tue, 30 Mar 2021 10:08:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRF2f-0001CH-E3 for grub-devel@gnu.org; Tue, 30 Mar 2021 10:08:25 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:54197) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lRF2c-0004Rc-B4 for grub-devel@gnu.org; Tue, 30 Mar 2021 10:08:25 -0400 Received: by mail-pj1-x1036.google.com with SMTP id t18so7811162pjs.3 for ; Tue, 30 Mar 2021 07:08:21 -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=mwU9SQQlBKuDz9XDiAdItae2H16z5bv+cYLEeAIafhg=; b=ZwwlrH0lWxvQk4gDzpouU/2A9f/ZmMkgpclMRlsGUSuEyxqqLWVEbCNvaX+bs5fqLa hHZQVQzSyx8kedwN95Zw3RS1ILycDazFB/hLL4jtyNsupBLOU24CDZmgOdh03QysOLoK /djMR3DzaNQjPztlWDz6PQK9YSYx53tcCO9YY= 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=mwU9SQQlBKuDz9XDiAdItae2H16z5bv+cYLEeAIafhg=; b=OyRZkbJ+8QdpyzmZsSXfmFgEkeqPRJlUkHMuuGSgwJWgdJBbsu/cRVWkHa3yOsrXed HmlvlTflRar3nxbJOJtJPEfzbQxBT2d1MKat0LRl86XM52Bm4OF7VcTy9cahDenKBdLg iOLPo13m827U1+BBUm2Skla7UbHdB/uYwf7HoPBKMSGjT+iysxbZvNRs4cmO8ehAwuer m2tNtKxDFnEyo8oqxifRYiu77rNISvWjbuOtqxQ+qWRkJpfdwLhExDV2YTUITjorEPNY H5ACXHps7lr1Whd+E1AvImTdqkMfv40yERckJcyCsoRnPL+j23J2Lz0ZNhoTHUscSv1j oaRQ== X-Gm-Message-State: AOAM530SZJAYHTC3jdgZtReQLQwnJzChMYUARxHo6JpCrUlwzvoyrHvn +WC2vtEwa6THfDmAykzqqCZsOEmtEHpWtA== X-Google-Smtp-Source: ABdhPJxY3jNI237aPyTG4V+uCL1m7zdvNC2rg3ISbnvcPN49lDm6ffFS3ImArhyP82JRv6QtEBCWyQ== X-Received: by 2002:a17:90a:f986:: with SMTP id cq6mr4505353pjb.175.1617113300737; Tue, 30 Mar 2021 07:08:20 -0700 (PDT) Received: from localhost (2001-44b8-111e-5c00-cc4e-3d4e-f51c-bb52.static.ipv6.internode.on.net. [2001:44b8:111e:5c00:cc4e:3d4e:f51c:bb52]) by smtp.gmail.com with ESMTPSA id z192sm20207146pgz.94.2021.03.30.07.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 07:08:20 -0700 (PDT) From: Daniel Axtens To: grub-devel@gnu.org Cc: rashmica.g@gmail.com, alastair@d-silva.org, Daniel Axtens Subject: [PATCH 07/19] posix_wrap: tweaks in preparation for libtasn1 Date: Wed, 31 Mar 2021 01:07:32 +1100 Message-Id: <20210330140744.176698-8-dja@axtens.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210330140744.176698-1-dja@axtens.net> References: <20210330140744.176698-1-dja@axtens.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=dja@axtens.net; helo=mail-pj1-x1036.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: Tue, 30 Mar 2021 14:08:25 -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.27.0