From: Christian Goeschel Ndjomouo Date: Mon, 1 Dec 2025 01:14:30 +0000 (-0500) Subject: include/c.h: add MAX_OF_UINT_TYPE macro to get max num of an uint type X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c841ec5eb35400abf2a65c58a799d4045942a8d;p=thirdparty%2Futil-linux.git include/c.h: add MAX_OF_UINT_TYPE macro to get max num of an uint type Signed-off-by: Christian Goeschel Ndjomouo --- diff --git a/include/c.h b/include/c.h index 0126591f2..e74a4486b 100644 --- a/include/c.h +++ b/include/c.h @@ -652,6 +652,7 @@ static inline int fputsln(const char *s, FILE *stream) { #endif #define SINT_MAX(t) (((t)1 << (sizeof(t) * 8 - 2)) - (t)1 + ((t)1 << (sizeof(t) * 8 - 2))) +#define MAX_OF_UINT_TYPE(t) ~((t)0) #ifndef HAVE_REALLOCARRAY static inline void *reallocarray(void *ptr, size_t nmemb, size_t size)