From 2b5af1034829f69be5e91fc39c10cea267a93025 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Sun, 31 Jan 2021 23:23:31 +0100 Subject: [PATCH] Add missing definition of SIZE_MAX If the stdint.h system file follows the ISO C99 specification, it might not define SIZE_MAX in C++ by default, so provide a local fallback. gcc/ * system.h (SIZE_MAX): Define if not already defined. --- gcc/system.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/system.h b/gcc/system.h index 5dd1c34c3a3..a3f5948aaee 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -535,6 +535,10 @@ extern void *realloc (void *, size_t); #include #endif +#ifndef SIZE_MAX +# define SIZE_MAX INTTYPE_MAXIMUM (size_t) +#endif + #ifdef __cplusplus extern "C" { #endif -- 2.30.2