[libc-commits] [libc] [libc] Fix size_t used without including stddef.h in CPP/limit.h. (PR #78861)
via libc-commits
libc-commits at lists.llvm.org
Sat Jan 20 13:09:32 PST 2024
https://github.com/lntue created https://github.com/llvm/llvm-project/pull/78861
None
>From 14bd8bd3479888a11e9399907f8c28b6fb4b8733 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Sat, 20 Jan 2024 21:08:04 +0000
Subject: [PATCH] [libc] Fix size_t used without including stddef.h in
CPP/limit.h.
---
libc/src/__support/CPP/limits.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/src/__support/CPP/limits.h b/libc/src/__support/CPP/limits.h
index e92ad00f80e037..d9e7090a0b7b19 100644
--- a/libc/src/__support/CPP/limits.h
+++ b/libc/src/__support/CPP/limits.h
@@ -20,7 +20,7 @@ namespace cpp {
// Some older gcc distributions don't define these for 32 bit targets.
#ifndef LLONG_MAX
-constexpr size_t LLONG_BIT_WIDTH = sizeof(long long) * 8;
+constexpr unsigned int LLONG_BIT_WIDTH = sizeof(long long) * 8;
constexpr long long LLONG_MAX = ~0LL ^ (1LL << (LLONG_BIT_WIDTH - 1));
constexpr long long LLONG_MIN = 1LL << (LLONG_BIT_WIDTH - 1);
constexpr unsigned long long ULLONG_MAX = ~0ULL;
More information about the libc-commits
mailing list