aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2005-10-15 22:35:55 +0000
committerDanny Smith <dannysmith@users.sourceforge.net>2005-10-15 22:35:55 +0000
commit654808f00c653ff830a1a12d2b04352b51a07f55 (patch)
treeb1e436cc7b0996e0e09722fc5ffe904ba87e88fd
parentd2c2c1328b5fa59452a0d7e945abeed2fa72fb58 (diff)
downloadnewlib-654808f00c653ff830a1a12d2b04352b51a07f55.zip
newlib-654808f00c653ff830a1a12d2b04352b51a07f55.tar.gz
newlib-654808f00c653ff830a1a12d2b04352b51a07f55.tar.bz2
* include/limits.h (SSIZE_MAX): Define.
(LLONG_MAX, LLONG_MIN, ULLONG_MAX): Separate from non-ISO names.
-rw-r--r--winsup/mingw/ChangeLog5
-rw-r--r--winsup/mingw/include/limits.h23
2 files changed, 19 insertions, 9 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog
index c814672..c41c5f5 100644
--- a/winsup/mingw/ChangeLog
+++ b/winsup/mingw/ChangeLog
@@ -1,3 +1,8 @@
+2005-10-14 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * include/limits.h (SSIZE_MAX): Define.
+ (LLONG_MAX, LLONG_MIN, ULLONG_MAX): Separate from non-ISO names.
+
2005-10-13 Wu Yongwei <adah@users.sourceforge.net>
* include/tchar.h: Include <wchar.h> when _UNICODE is defined.
diff --git a/winsup/mingw/include/limits.h b/winsup/mingw/include/limits.h
index a76bf68..04f79f5 100644
--- a/winsup/mingw/include/limits.h
+++ b/winsup/mingw/include/limits.h
@@ -28,7 +28,7 @@
* NOTE: Apparently the actual size of PATH_MAX is 260, but a space is
* required for the NUL. TODO: Test?
*/
-#define PATH_MAX (259)
+#define PATH_MAX 259
/*
* Characteristics of the char data type.
@@ -75,27 +75,32 @@
* TODO: This is not correct for Alphas, which have 64 bit longs.
*/
#define LONG_MAX 2147483647L
-
#define LONG_MIN (-LONG_MAX-1)
#define ULONG_MAX 0xffffffffUL
+#ifndef __STRICT_ANSI__
+/* POSIX wants this. */
+#define SSIZE_MAX LONG_MAX
+#endif
+
+#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
+ || !defined(__STRICT_ANSI__)
+/* ISO C9x macro names */
+#define LLONG_MAX 9223372036854775807LL
+#define LLONG_MIN (-LLONG_MAX - 1)
+#define ULLONG_MAX (2ULL * LLONG_MAX + 1)
+#endif
/*
* The GNU C compiler also allows 'long long int'
*/
-#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
+#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
#define LONG_LONG_MAX 9223372036854775807LL
#define LONG_LONG_MIN (-LONG_LONG_MAX-1)
-
#define ULONG_LONG_MAX (2ULL * LONG_LONG_MAX + 1)
-/* ISO C9x macro names */
-#define LLONG_MAX LONG_LONG_MAX
-#define LLONG_MIN LONG_LONG_MIN
-#define ULLONG_MAX ULONG_LONG_MAX
-
/* MSVC compatibility */
#define _I64_MIN LONG_LONG_MIN
#define _I64_MAX LONG_LONG_MAX