aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Boehm <hboehm@google.com>2014-07-16 11:33:48 -0700
committerHans Boehm <hboehm@google.com>2014-07-16 17:31:05 -0700
commit8b002362d996859ebfc8588d6859a9a79203dc27 (patch)
tree956126751b812cbba9b829bc81167207e72d4ba7
parent385bb1ededa734e88bafb8aaf817e9a984bf0d18 (diff)
downloadandroid_bionic-8b002362d996859ebfc8588d6859a9a79203dc27.tar.gz
android_bionic-8b002362d996859ebfc8588d6859a9a79203dc27.tar.bz2
android_bionic-8b002362d996859ebfc8588d6859a9a79203dc27.zip
Define atomic_charN_t only if charN_t is supported.
Some platform code is apparently compiled with switches that do not support char16_t and char32_t. This caused stdatomic.h to fail to compile. This CL makes stdatomic.h usable in those environments. Change-Id: Ie5a17f20b8b545c97128d00605b4eabd2a6bfe3e
-rw-r--r--libc/include/stdatomic.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libc/include/stdatomic.h b/libc/include/stdatomic.h
index 43ec7534b..669cefd66 100644
--- a/libc/include/stdatomic.h
+++ b/libc/include/stdatomic.h
@@ -205,8 +205,10 @@ typedef _Atomic(long) atomic_long;
typedef _Atomic(unsigned long) atomic_ulong;
typedef _Atomic(long long) atomic_llong;
typedef _Atomic(unsigned long long) atomic_ullong;
-typedef _Atomic(char16_t) atomic_char16_t;
-typedef _Atomic(char32_t) atomic_char32_t;
+#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
+ typedef _Atomic(char16_t) atomic_char16_t;
+ typedef _Atomic(char32_t) atomic_char32_t;
+#endif
typedef _Atomic(wchar_t) atomic_wchar_t;
typedef _Atomic(int_least8_t) atomic_int_least8_t;
typedef _Atomic(uint_least8_t) atomic_uint_least8_t;