Skip to content

Commit

Permalink
* libc/include/sys/_types.h (_ssize_t): Define as signed equivalent of
Browse files Browse the repository at this point in the history
	size_t with GCC.
  • Loading branch information
github-cygwin committed Feb 21, 2013
1 parent 7b3739f commit 7080b36
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions newlib/ChangeLog
@@ -1,3 +1,9 @@
2013-02-20 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Joseph S. Myers <joseph@codesourcery.com>

* libc/include/sys/_types.h (_ssize_t): Define as signed equivalent of
size_t with GCC.

2013-02-19 Steve Ellcey <sellcey@mips.com>

* libc/machine/mips/memcpy.S: Fix USE_PREFETCH check.
Expand Down
9 changes: 9 additions & 0 deletions newlib/libc/include/sys/_types.h
Expand Up @@ -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>
Expand Down

0 comments on commit 7080b36

Please sign in to comment.