diff options
author | Christophe Lombard <clombard@linux.ibm.com> | 2023-06-20 16:51:59 +0200 |
---|---|---|
committer | Reza Arbab <arbab@linux.ibm.com> | 2023-09-12 14:22:11 -0500 |
commit | 475ee1cfbe28941d799bd9e2a66867addc24ef64 (patch) | |
tree | 1a43e327496b387b6324c9b0afe55f744fcc9932 /libc | |
parent | dbd5de6624d7466bb67d1eb4e57bc3a8e2ad9e87 (diff) | |
download | skiboot-475ee1cfbe28941d799bd9e2a66867addc24ef64.zip skiboot-475ee1cfbe28941d799bd9e2a66867addc24ef64.tar.gz skiboot-475ee1cfbe28941d799bd9e2a66867addc24ef64.tar.bz2 |
libc: Expand limits.h and include in stdint.h
Add maximum native integer size and limits of specified-width integer
types.
These types are required by the external library: libpldm.
Signed-off-by: Christophe Lombard <clombard@linux.ibm.com>
Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
Diffstat (limited to 'libc')
-rw-r--r-- | libc/include/limits.h | 6 | ||||
-rw-r--r-- | libc/include/stdint.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libc/include/limits.h b/libc/include/limits.h index bfde963..0c85d2e 100644 --- a/libc/include/limits.h +++ b/libc/include/limits.h @@ -33,5 +33,11 @@ #define UINT32_MAX UINT_MAX #define INT32_MAX INT_MAX +#define UINT16_MAX USHRT_MAX +#define UINT8_MAX UCHAR_MAX + +#ifndef SIZE_MAX +#define SIZE_MAX (~0ull) +#endif #endif diff --git a/libc/include/stdint.h b/libc/include/stdint.h index 2a2c1d9..080d875 100644 --- a/libc/include/stdint.h +++ b/libc/include/stdint.h @@ -13,6 +13,9 @@ #ifndef _STDINT_H #define _STDINT_H +/* C99 requires *_MAX to be in stdint.h */ +#include <limits.h> + typedef unsigned char uint8_t; typedef signed char int8_t; |