aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2016-06-09 16:32:54 -0700
committerChristopher Ferris <cferris@google.com>2016-06-09 16:35:37 -0700
commit47fcffff60be97ae827b0779d09d1a8756c299b7 (patch)
tree5576d6cc6d28b3475c2ea9de7a2fb7e32b9f607a
parent70d99a1053542b8c062e6cb7eca2bcfb16c25d55 (diff)
downloadbionic-47fcffff60be97ae827b0779d09d1a8756c299b7.tar.gz
Fix the SIZE_T_MAX SSIZE_MAX defines.
This should not affect the underlying values, just the types used by the defines. This fixes any warnings where code does something like: printf("%zx", SIZE_T_MAX); Change-Id: I4beb6d382f30261e4fe133a88fb503984911326d
-rw-r--r--libc/include/limits.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libc/include/limits.h b/libc/include/limits.h
index 01b7a495f..7543567dd 100644
--- a/libc/include/limits.h
+++ b/libc/include/limits.h
@@ -70,10 +70,18 @@
/* BSD compatibility definitions. */
#if __BSD_VISIBLE
+#if defined(__LP64__)
#define SIZE_T_MAX ULONG_MAX
+#else
+#define SIZE_T_MAX UINT_MAX
+#endif
#endif /* __BSD_VISIBLE */
+#if defined(__LP64__)
#define SSIZE_MAX LONG_MAX
+#else
+#define SSIZE_MAX INT_MAX
+#endif
#define MB_LEN_MAX 4