summaryrefslogtreecommitdiff
path: root/ndk
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-06-13 19:03:26 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-06-10 21:55:12 +0000
commite577c6b4e3fbc35768f400b40951f43e88a61033 (patch)
tree10725ce3743040d91e489414e429919f6000c204 /ndk
parent724e34687c3cf77946fe94c7e655e7ab5e0f7124 (diff)
parent9983b467e539d40388880739fcf8a8becd459b26 (diff)
Merge "Fix ssize_t, WCHAR_MIN and WCHAR_MAX"
Diffstat (limited to 'ndk')
-rw-r--r--ndk/platforms/android-3/include/stdint.h2
-rw-r--r--ndk/platforms/android-3/include/sys/_wchar_limits.h21
-rw-r--r--ndk/platforms/android-3/include/sys/types.h2
3 files changed, 9 insertions, 16 deletions
diff --git a/ndk/platforms/android-3/include/stdint.h b/ndk/platforms/android-3/include/stdint.h
index 7ae2595b8..244dd4d5c 100644
--- a/ndk/platforms/android-3/include/stdint.h
+++ b/ndk/platforms/android-3/include/stdint.h
@@ -251,7 +251,7 @@ typedef int64_t intmax_t;
/* size_t is defined by the GCC-specific <stddef.h> */
#ifndef _SSIZE_T_DEFINED_
#define _SSIZE_T_DEFINED_
-typedef long int ssize_t;
+typedef int ssize_t;
#endif
#define _BITSIZE 32
diff --git a/ndk/platforms/android-3/include/sys/_wchar_limits.h b/ndk/platforms/android-3/include/sys/_wchar_limits.h
index 644792f77..12bc6b130 100644
--- a/ndk/platforms/android-3/include/sys/_wchar_limits.h
+++ b/ndk/platforms/android-3/include/sys/_wchar_limits.h
@@ -86,21 +86,14 @@
# else
/* Otherwise, the value is derived from the toolchain configuration.
* to avoid putting explicit CPU checks in this header. */
-# ifndef __WCHAR_MAX__
-# error "__WCHAR_MAX__ is not defined. Check your toolchain!"
+# define WCHAR_MAX __WCHAR_MAX__
+
+ /* Clang does not define __WCHAR_MIN__ */
+# if defined(__WCHAR_UNSIGNED__)
+# define WCHAR_MIN L'\0'
+# else
+# define WCHAR_MIN (-(WCHAR_MAX) - 1)
# endif
- /* Clang does define __WCHAR_MAX__, but not __WCHAR_MIN__ */
-# ifndef __WCHAR_MIN__
-# if __WCHAR_MAX__ == 4294967295
-# define __WCHAR_MIN__ (0U)
-# elif __WCHAR_MAX__ == 2147483647
-# define __WCHAR_MIN__ (-2147483647 - 1)
-# else
-# error "Invalid __WCHAR_MAX__ value. Check your toolchain!"
-# endif
-# endif /* !__WCHAR_MIN__ */
-# define WCHAR_MIN __WCHAR_MIN__
-# define WCHAR_MAX __WCHAR_MAX__
# endif /* !_WCHAR_IS_ALWAYS_SIGNED */
#endif /* !WCHAR_MIN */
diff --git a/ndk/platforms/android-3/include/sys/types.h b/ndk/platforms/android-3/include/sys/types.h
index 15ecb373a..f7f986c04 100644
--- a/ndk/platforms/android-3/include/sys/types.h
+++ b/ndk/platforms/android-3/include/sys/types.h
@@ -87,7 +87,7 @@ typedef .... pthread_t;
#ifndef _SSIZE_T_DEFINED_
#define _SSIZE_T_DEFINED_
-typedef long int ssize_t;
+typedef int ssize_t;
#endif
typedef __kernel_suseconds_t suseconds_t;