]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
include/c.h: add MAX_OF_UINT_TYPE macro to get max num of an uint type
authorChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Mon, 1 Dec 2025 01:14:30 +0000 (20:14 -0500)
committerChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Mon, 1 Dec 2025 07:57:20 +0000 (02:57 -0500)
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
include/c.h

index 0126591f2b6e30c29f6ab1aa4e45f69f95c31c47..e74a4486bf97d722ed85c3af05d616e892c11083 100644 (file)
@@ -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)