Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kXaj7-0000nL-HT for mharc-grub-devel@gnu.org; Tue, 27 Oct 2020 21:58:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXaj4-0000fm-KM for grub-devel@gnu.org; Tue, 27 Oct 2020 21:58:10 -0400 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:35936) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXaj2-0007oW-TP for grub-devel@gnu.org; Tue, 27 Oct 2020 21:58:10 -0400 Received: by mail-pj1-x1043.google.com with SMTP id t24so40618pji.1 for ; Tue, 27 Oct 2020 18:58:07 -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=HYqciTn63xMcL2wsDT9OcV7Xbqu47eQcrsAI/gNnkqE=; b=qvqI27KPNddSMDaSdwSV3Gg5imCAYAqlzccu3kGdw6e6s/dV3ynrJInlgJjmygK3YP HwUYgrKIyEYY7Jsq37pz0kswH6pL3pSKu8E/RWIz0dOoJGcBYl3vQdgZXoSdffgZKdzF lS7ux1SkEi4ScC7qVXZGm9zVX401vBNCFnqhA= 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=HYqciTn63xMcL2wsDT9OcV7Xbqu47eQcrsAI/gNnkqE=; b=l/MmiD+fUSp61DnL2tOgW6GKw50g0tOCfWAeF8z+AZfNQ0BZ+1gQkeSFhykILt6Mkf ubxWP8PveQulBVJJXDp/SUeFiIy3JJpseP5bllu98AjnrdMHtJPj9dblx/Xv8i2CjRE9 J7SEDp3AEKAJyXWhuc5Z5UDXPAlbvmf0pFYcqV9uePONDGznZxNKV6Wt8/3EhafwUHpY Qyu32BoMmZvr/sCbhndDoMbGAQ5kFjNI0g6dY7jjhf8KDO6F1m1Id4F1BzavEPlGlSQ4 LYNrnvVj2OP/duk+PQ2K6z0hyIIcueV/gJ2nG/gCGrV8Bdw9ZIf/Z04gfXD8/aeI1jN/ pbbQ== X-Gm-Message-State: AOAM5319wR+m7WuQm9NQoO0dHbrY3aGOE6m7rEpJRgk7gVWT7GUMkk+Y acihfb2V4/I0sqizK4f1X5abB/Hy2Pfthg== X-Google-Smtp-Source: ABdhPJwwDHpInwHWN4hRql356lw2Y63DLjqFXofzMGHo63gDpBuJxWMk42W4pkL/9mZIA6vg89Us/g== X-Received: by 2002:a17:902:b696:b029:d2:1ebe:d80c with SMTP id c22-20020a170902b696b02900d21ebed80cmr5079924pls.18.1603850286791; Tue, 27 Oct 2020 18:58:06 -0700 (PDT) Received: from localhost (2001-44b8-1113-6700-b4f7-e8d4-abaa-2197.static.ipv6.internode.on.net. [2001:44b8:1113:6700:b4f7:e8d4:abaa:2197]) by smtp.gmail.com with ESMTPSA id v66sm3580375pfb.139.2020.10.27.18.58.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 18:58:06 -0700 (PDT) From: Daniel Axtens To: grub-devel@gnu.org Cc: rashmica.g@gmail.com, alastair@d-silva.org, Daniel Axtens Subject: [PATCH v2 07/18] posix_wrap: tweaks in preparation for libtasn1 Date: Wed, 28 Oct 2020 12:57:24 +1100 Message-Id: <20201028015735.1131291-8-dja@axtens.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201028015735.1131291-1-dja@axtens.net> References: <20201028015735.1131291-1-dja@axtens.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::1043; envelope-from=dja@axtens.net; helo=mail-pj1-x1043.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, 28 Oct 2020 01:58:10 -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.25.1