diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2013-12-23 19:21:07 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2013-12-23 19:21:07 +0000 |
commit | b153931f1833ff80bdd27d9b6ae1dee56d36ed8a (patch) | |
tree | ee1726f7e2363dc34123c26de5922f636a953247 /newlib/libc/include/wchar.h | |
parent | 2d15421aa8f802cd987098fe6d13462c0b383c1a (diff) | |
download | cygnal-b153931f1833ff80bdd27d9b6ae1dee56d36ed8a.tar.gz cygnal-b153931f1833ff80bdd27d9b6ae1dee56d36ed8a.tar.bz2 cygnal-b153931f1833ff80bdd27d9b6ae1dee56d36ed8a.zip |
2013-12-22 JF Bastien <jfb@chromium.org>
* libc/include/limits.h: Define LLONG_MIN, LLONG_MAX and ULLONG_MAX
for C++11 too.
* libc/include/stdlib.h: Define struct lldiv_t, _Exit, atoll, llabs
and lldiv for C99 and C++11. Move wcstold to wchar.h.
* libc/include/wchar.h: Define WCHAR_MIN and WCHAR_MAX according to
__WCHAR_UNSIGNED__ if it is provided, and correct the limit when
unsigned (to 32 all-1 bits, not 31). Define FILE as in stdio.h.
Move wcstold from stdlib.h here.
Diffstat (limited to 'newlib/libc/include/wchar.h')
-rw-r--r-- | newlib/libc/include/wchar.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/newlib/libc/include/wchar.h b/newlib/libc/include/wchar.h index 6f72dcf54..cdc8571aa 100644 --- a/newlib/libc/include/wchar.h +++ b/newlib/libc/include/wchar.h @@ -25,19 +25,30 @@ #endif #ifndef WCHAR_MIN -#define WCHAR_MIN 0 +#ifdef __WCHAR_MIN__ +#define WCHAR_MIN __WCHAR_MIN__ +#elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0) +#define WCHAR_MIN (0 + L'\0') +#else +#define WCHAR_MIN (-0x7fffffff - 1 + L'\0') +#endif #endif #ifndef WCHAR_MAX #ifdef __WCHAR_MAX__ #define WCHAR_MAX __WCHAR_MAX__ +#elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0) +#define WCHAR_MAX (0xffffffffu + L'\0') #else -#define WCHAR_MAX 0x7fffffffu +#define WCHAR_MAX (0x7fffffff + L'\0') #endif #endif _BEGIN_STD_C +/* As in stdio.h, <sys/reent.h> defines __FILE. */ +typedef __FILE FILE; + /* As required by POSIX.1-2008, declare tm as incomplete type. The actual definition is in time.h. */ struct tm; @@ -130,6 +141,10 @@ long _EXFUN(_wcstol_r, (struct _reent *, const wchar_t *, wchar_t **, int)); long long _EXFUN(_wcstoll_r, (struct _reent *, const wchar_t *, wchar_t **, int)); unsigned long _EXFUN(_wcstoul_r, (struct _reent *, const wchar_t *, wchar_t **, int)); unsigned long long _EXFUN(_wcstoull_r, (struct _reent *, const wchar_t *, wchar_t **, int)); +/* On platforms where long double equals double. */ +#ifdef _LDBL_EQ_DBL +long double _EXFUN(wcstold, (const wchar_t *, wchar_t **)); +#endif /* _LDBL_EQ_DBL */ wint_t _EXFUN(fgetwc, (__FILE *)); wchar_t *_EXFUN(fgetws, (wchar_t *__restrict, int, __FILE *__restrict)); |