From patchwork Fri Dec 21 07:32:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: fwts_uefi:uefirtvariable:use sizeof() for defining long integer for fixing build failure on 32 bit systems Date: Thu, 20 Dec 2012 21:32:40 -0000 From: IvanHu X-Patchwork-Id: 207765 Message-Id: <1356075160-19477-1-git-send-email-ivan.hu@canonical.com> To: fwts-devel@lists.ubuntu.com Since the define EFI_NOT_FOUND is move from uefirtvariable.c to fwts_uefi.h the use sizeof() to find the bit size of the long integer rather than a fixed value, which avoid build failure should apply on fwts_uefi.h. Signed-off-by: Ivan Hu Acked-by: Keng-Yu Lin Acked-by: Alex Hung --- src/lib/include/fwts_uefi.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h index 72d3c10..2771c55 100644 --- a/src/lib/include/fwts_uefi.h +++ b/src/lib/include/fwts_uefi.h @@ -46,7 +46,9 @@ enum { FWTS_UEFI_TIME_IN_DAYLIGHT = 0x02 }; -#define HIGH_BIT_SET (1UL << 63) +#define BITS_PER_LONG (sizeof(long) * 8) + +#define HIGH_BIT_SET (1UL << (BITS_PER_LONG-1)) #define EFI_SUCCESS 0 #define EFI_LOAD_ERROR (1 | HIGH_BIT_SET)