diff options
Diffstat (limited to '9/platforms/android-8/arch-arm/usr/include/wchar.h')
-rw-r--r-- | 9/platforms/android-8/arch-arm/usr/include/wchar.h | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/9/platforms/android-8/arch-arm/usr/include/wchar.h b/9/platforms/android-8/arch-arm/usr/include/wchar.h index e67b0be..b9dfa66 100644 --- a/9/platforms/android-8/arch-arm/usr/include/wchar.h +++ b/9/platforms/android-8/arch-arm/usr/include/wchar.h @@ -40,6 +40,7 @@ #include <malloc.h> #include <stddef.h> +#include <sys/_wchar_limits.h> /* IMPORTANT: Any code that relies on wide character support is essentially * non-portable and/or broken. the only reason this header exist @@ -70,36 +71,15 @@ typedef enum { WC_TYPE_MAX } wctype_t; -/* TECHNICAL NOTE: This is tricky! - * - * Due to the following inclusion chain: - * <wchar.h> -> <stdio.h> -> <sys/types.h> -> <stdint.h> - * - * WCHAR_MIN / WCHAR_MAX will already be defined to INT32_MIN / INT32_MAX - * when reaching this line in the following cases: - * - Compiling C source code. - * - Compiling C++ source code AND having __STDC_LIMIT_MACROS defined. - * - * When _WCHAR_IS_8BIT is defined, it should emulate the old behaviour. - * which was to set the values to 0 and 255, respectively. - */ -#ifndef WCHAR_MAX -# ifdef _WCHAR_IS_8BIT -# define WCHAR_MAX 255 -# define WCHAR_MIN 0 -# else -/* Same values as INT32_MIN/INT32_MAX, without including <stdint.h> */ -# define WCHAR_MAX (2147483647) -# define WCHAR_MIN (-1-2147483647) -# endif -#endif - -/* Similarly, WEOF used to be defined as simply -1, which is +/* WEOF used to be defined as simply -1, which is * invalid (the standard mandates that the expression must have wint_t - * type). There is no difference in C, but there is one in C++!! - * - * Revert to the old broken behaviour is _WCHAR_IS_8BIT is defined. - */ + * type). Revert to the old broken behaviour is _WCHAR_IS_8BIT is defined. + * See http://b.android.com/57267 */ +#ifdef _WCHAR_IS_8BIT +#define WEOF (-1) +#else +#define WEOF ((wint_t)-1) +#endif #ifdef _WCHAR_IS_8BIT #define WEOF (-1) #else @@ -160,7 +140,7 @@ extern wchar_t *wcsrchr(const wchar_t *, wchar_t); extern size_t wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *); extern size_t wcsspn(const wchar_t *, const wchar_t *); extern wchar_t *wcsstr(const wchar_t *, const wchar_t *); -extern double wcstod(const wchar_t *, wchar_t **); +extern double wcstod(const wchar_t *, wchar_t **) __NDK_FPABI__; extern wchar_t *wcstok(wchar_t *, const wchar_t *, wchar_t **); extern long int wcstol(const wchar_t *, wchar_t **, int); extern size_t wcstombs(char *, const wchar_t *, size_t); |