]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add missing definition of SIZE_MAX
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 31 Jan 2021 22:23:31 +0000 (23:23 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Sun, 31 Jan 2021 23:06:16 +0000 (00:06 +0100)
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

index 544f7ba427feed15d768f819fc308d34b66842aa..263070169abb974e518209833f3b0a2a52595552 100644 (file)
@@ -528,6 +528,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