From 721e5743988a5692079ec773cbc9d065a26a5981 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Mon, 12 Aug 2024 22:29:40 +1000 Subject: [PATCH] base: avoid "#if SIZE_MAX < UINT64_MAX" This fixes a -Werror=undef failure with coreboot's compiler. --- internal/cgen/base/image-public.h | 2 +- release/c/wuffs-unsupported-snapshot.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cgen/base/image-public.h b/internal/cgen/base/image-public.h index 37fc8061..a890e5e6 100644 --- a/internal/cgen/base/image-public.h +++ b/internal/cgen/base/image-public.h @@ -651,7 +651,7 @@ wuffs_base__pixel_config__set(wuffs_base__pixel_config* c, } if (pixfmt_repr) { do { -#if SIZE_MAX < UINT64_MAX +#if SIZE_MAX < 0xFFFFFFFFFFFFFFFFull uint64_t wh = ((uint64_t)width) * ((uint64_t)height); // TODO: handle things other than 1 byte per pixel. if (wh > ((uint64_t)SIZE_MAX)) { diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index b3c4abb2..8ca2471e 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -4664,7 +4664,7 @@ wuffs_base__pixel_config__set(wuffs_base__pixel_config* c, } if (pixfmt_repr) { do { -#if SIZE_MAX < UINT64_MAX +#if SIZE_MAX < 0xFFFFFFFFFFFFFFFFull uint64_t wh = ((uint64_t)width) * ((uint64_t)height); // TODO: handle things other than 1 byte per pixel. if (wh > ((uint64_t)SIZE_MAX)) {