Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kODOT-0003Tk-Ck for mharc-grub-devel@gnu.org; Fri, 02 Oct 2020 01:14:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kODOM-0003OT-Aa for grub-devel@gnu.org; Fri, 02 Oct 2020 01:14:02 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:33924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kODOK-00056Y-OT for grub-devel@gnu.org; Fri, 02 Oct 2020 01:14:02 -0400 Received: by mail-pg1-x541.google.com with SMTP id u24so97964pgi.1 for ; Thu, 01 Oct 2020 22:13:59 -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=yeBAuCHdNNfCxnpceDCQ1Rm82R1+QWc5DitHfdo9diY=; b=LVTHeSFUSp4zp1bvqomaN5UBLMRVY0JlhMd5us+AIICWj8Ru94S/HxJpa+JBH+dthi eAdAk3cqFEOGFNplwfkTE7KefiA60gEqu/YFWF/TuszyMr0SklO6QAmq9gXzIL5yNqDa 4ILCWjLdMixeKSpdgmwIOeV/6rxtup84FgsJM= 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=yeBAuCHdNNfCxnpceDCQ1Rm82R1+QWc5DitHfdo9diY=; b=abrDv7RVvWhFvKRQEcafrdPZ32pmfeRv7H4muDzUWtoC7tKwvs+Yv5ymLq79KAtUhc YV6r7p5JdsNZCuxSwhGMGE1m1vt26EFocngcNAsmISXrCYVfd8vnYKJ+Qs0uBxXbDvrR v0E0RaZkNQjry0cyvM4Gx3eRcZsdGNVCsahE9bbPqoV99J+z+8w6Knxa8IgKt0DHyMYj 2X0WVrjwux3YdgqYa3Ey+th/TYiFML8ngHeoPBhim3Hx3B+nyxL1CiMJMmspnSsvMKVB 18XzwFNqRYZzsIKoKc+lk6/cLVmR41UTD/BF6VPaAlHyFhYZ7TFzST386TJjiRyPnOuE a6SQ== X-Gm-Message-State: AOAM532GFgrdOkNDXZFCtzfvjLRZk6FoFbzynW9ZJ0ftTickRt7Vo5RA QDrHi/jMxlPB3ia3vdTdxy2YuTp4Z7CGuA== X-Google-Smtp-Source: ABdhPJxYWeUhpCuSuLSbsqOpxSteaOUG18MBeJikNjfLUmdeNcdoo5sDWxkyBnOhXDUrWKOLKJTZLA== X-Received: by 2002:a62:8c88:0:b029:13e:d13d:a08b with SMTP id m130-20020a628c880000b029013ed13da08bmr722128pfd.34.1601615638294; Thu, 01 Oct 2020 22:13:58 -0700 (PDT) Received: from localhost (2001-44b8-111e-5c00-804e-30c2-4157-6268.static.ipv6.internode.on.net. [2001:44b8:111e:5c00:804e:30c2:4157:6268]) by smtp.gmail.com with ESMTPSA id b11sm359646pfd.33.2020.10.01.22.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 22:13:57 -0700 (PDT) From: Daniel Axtens To: grub-devel@gnu.org Cc: rashmica.g@gmail.com, alastair@d-silva.org, Daniel Axtens Subject: [PATCH 07/18] posix_wrap: tweaks in preparation for libtasn1 Date: Fri, 2 Oct 2020 15:13:10 +1000 Message-Id: <20201002051321.1538488-8-dja@axtens.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201002051321.1538488-1-dja@axtens.net> References: <20201002051321.1538488-1-dja@axtens.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::541; envelope-from=dja@axtens.net; helo=mail-pg1-x541.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: Fri, 02 Oct 2020 05:14:03 -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 3b46f47ff504..8a1bede218dd 100644 --- a/grub-core/lib/posix_wrap/stdlib.h +++ b/grub-core/lib/posix_wrap/stdlib.h @@ -52,4 +52,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