diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2013-02-21 16:27:11 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2013-02-21 16:27:11 +0400 |
commit | 7080b364170f3b0c10518f3c4ad3585c6845c16e (patch) | |
tree | b475f84d7866dd47d5ef3b0af658ef75b02ae5dd /newlib/libc | |
parent | 7b3739f2aea793bece7d8489f0c9b8d41c2b1af7 (diff) |
* 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.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h index 25252ed83..e8ac429e7 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> |