aboutsummaryrefslogtreecommitdiff
path: root/gcc/system.h
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2021-01-31 23:23:31 +0100
committerEric Botcazou <ebotcazou@adacore.com>2021-01-31 23:25:56 +0100
commit2b5af1034829f69be5e91fc39c10cea267a93025 (patch)
treece767066cbcb2f79bc8a2e6d0ad1823bd7296cb5 /gcc/system.h
parent98342bdd2b7085c9e7e4c9fbb07c3917a0013515 (diff)
downloadgcc-2b5af1034829f69be5e91fc39c10cea267a93025.zip
gcc-2b5af1034829f69be5e91fc39c10cea267a93025.tar.gz
gcc-2b5af1034829f69be5e91fc39c10cea267a93025.tar.bz2
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.
Diffstat (limited to 'gcc/system.h')
-rw-r--r--gcc/system.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/system.h b/gcc/system.h
index 5dd1c34..a3f5948 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -535,6 +535,10 @@ extern void *realloc (void *, size_t);
#include <inttypes.h>
#endif
+#ifndef SIZE_MAX
+# define SIZE_MAX INTTYPE_MAXIMUM (size_t)
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif