From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kbG8i-0008SI-0d for mharc-grub-devel@gnu.org; Fri, 06 Nov 2020 23:47:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbG8d-0008M6-K7 for grub-devel@gnu.org; Fri, 06 Nov 2020 23:47:45 -0500 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]:40957) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kbG8Y-0002oY-Ud for grub-devel@gnu.org; Fri, 06 Nov 2020 23:47:43 -0500 Received: by mail-ot1-x333.google.com with SMTP id 79so3310298otc.7 for ; Fri, 06 Nov 2020 20:47:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Huzm04lXOkR5fcXMk5+ofTuOqOvJ2PP4Fl9MjMUxuks=; b=nR7iFmcUitUoqaj3Iw6R9/XxCDZHkvoUoHvR24Kx/WeIoSph5PoJsAtEw5GdsSYI9G rIoUDEF/OngBKYzyXzUGZ6bXTuMsTVJ9Ej73XnGcXryxvdPDVIsRJxG+pxi96eip8iK/ cf0+elkILfCZCGatEpRXKPaOg4jzSiTnCN3NswMByZGQKKdSen/yNW752gEOeczwNLpo E2EydosdMGrIXMhHbHPIqwPz61Oeh2CHAzfQrSBqwrmhY2bhLOKd9qid6ScIIvDNqVSd 1LapeXSL7Naefd1O4fbHZz6RCoa0BtEBjeuOS1UnNr5aV1tihIwPe7UqKSQu+vwFPkcM 2SSQ== 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=Huzm04lXOkR5fcXMk5+ofTuOqOvJ2PP4Fl9MjMUxuks=; b=SXPx9czDXmYD1cC3FKxgHWPbVTFDA1miKWp5rYYzKJxd88Z5/V+nIdeXN+1lGxClwU 3h8QkZg4qMHq0nQADpyur2q21IdbX2XKDhr6okfvfD70cQTDZMoLDnheM4wXGSi9ixQq m0APd8ZR7MbNwjWr9iZH+cXSSN8qMbORnG7m/TeTZ7y/UEIovlJVPzE9+/TFHukLrz6i dHJILnR5Rl8/kyLtw6m8ErarbKCMYMfjLQgx9AvxnakNnxS0GaZ0PoJGDcd1n20eq2Er QKelGEdSApsMi+6weDgG001G4jxEhZLPrQctTiW8UTgWgblk4Baq98LcDXLYOdlbwCSY nLcg== X-Gm-Message-State: AOAM531lidZTiidsXTC5J3TX21hK2TmTGPE5gVqYSM5NMzUeDOhR3PYk mcUa5hfymTI9UkcBMnZdrYlzV74nyjNnGo/P X-Google-Smtp-Source: ABdhPJyOrZFS9lzPHrac2RZiRamKPIA9SvtAqJXrkNcUUsSjbcbvIGXPJwgN85ZiNk/YBAQ8xtvkTQ== X-Received: by 2002:a9d:f44:: with SMTP id 62mr3535137ott.17.1604724457275; Fri, 06 Nov 2020 20:47:37 -0800 (PST) Received: from localhost.localdomain ([136.49.44.103]) by smtp.gmail.com with ESMTPSA id x25sm836888oie.17.2020.11.06.20.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2020 20:47:36 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org Cc: Patrick Steinhardt , Daniel Kiper , Glenn Washburn Subject: [PATCH v4 04/15] types: Define GRUB_CHAR_BIT based on compiler macro instead of using literal. Date: Fri, 6 Nov 2020 22:44:24 -0600 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::333; envelope-from=development@efficientek.com; helo=mail-ot1-x333.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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-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: Sat, 07 Nov 2020 04:47:45 -0000 Signed-off-by: Glenn Washburn --- include/grub/types.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/grub/types.h b/include/grub/types.h index 035a4b528..495c86bb1 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -72,6 +72,14 @@ # endif #endif +#ifndef __CHAR_BIT__ +#error __CHAR_BIT__ is not defined +#elif __CHAR_BIT__ != 8 +#error __CHAR_BIT__ is not equal 8 +#else +#define GRUB_CHAR_BIT __CHAR_BIT__ +#endif + /* Define various wide integers. */ typedef signed char grub_int8_t; typedef short grub_int16_t; @@ -317,6 +325,4 @@ static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val) dd->d = val; } -#define GRUB_CHAR_BIT 8 - #endif /* ! GRUB_TYPES_HEADER */ -- 2.27.0