aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-02-21 12:27:11 +0000
committerCorinna Vinschen <corinna@vinschen.de>2013-02-21 12:27:11 +0000
commit7080b364170f3b0c10518f3c4ad3585c6845c16e (patch)
treeb475f84d7866dd47d5ef3b0af658ef75b02ae5dd /newlib/libc
parent7b3739f2aea793bece7d8489f0c9b8d41c2b1af7 (diff)
downloadnewlib-7080b364170f3b0c10518f3c4ad3585c6845c16e.zip
newlib-7080b364170f3b0c10518f3c4ad3585c6845c16e.tar.gz
newlib-7080b364170f3b0c10518f3c4ad3585c6845c16e.tar.bz2
* libc/include/sys/_types.h (_ssize_t): Define as signed equivalent of
size_t with GCC.
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/include/sys/_types.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
index 25252ed..e8ac429 100644
--- a/newlib/libc/include/sys/_types.h
+++ b/newlib/libc/include/sys/_types.h
@@ -52,12 +52,21 @@ typedef _off64_t _fpos64_t;
#endif
#ifndef __ssize_t_defined
+#ifdef __SIZE_TYPE__
+/* If __SIZE_TYPE__ is defined (gcc) we define ssize_t based on size_t.
+ We simply change "unsigned" to "signed" for this single definition
+ to make sure ssize_t and size_t only differ by their signedness. */
+#define unsigned signed
+typedef __SIZE_TYPE__ _ssize_t;
+#undef unsigned
+#else
#if defined(__INT_MAX__) && __INT_MAX__ == 2147483647
typedef int _ssize_t;
#else
typedef long _ssize_t;
#endif
#endif
+#endif
#define __need_wint_t
#include <stddef.h>