From b14f65cb50d020982866cb2ca0f932171abc7aa1 Mon Sep 17 00:00:00 2001 From: Hans Boehm Date: Wed, 16 Jul 2014 11:53:31 -0700 Subject: [PATCH] Do not typedef char16_t if it is a keyword. Don't define char16_t on platforms where char16_t is a keyword, as C11 and C++11 define it to be. (cherry picked from commit dfdbe61d28dbf3e45b6108d739170482ca19a03c) Change-Id: I6717bc2133c1363ecd85861f3869e1eabd2ce96a --- include/cutils/jstring.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/cutils/jstring.h b/include/cutils/jstring.h index ee0018fcc..a3426081a 100644 --- a/include/cutils/jstring.h +++ b/include/cutils/jstring.h @@ -24,7 +24,10 @@ extern "C" { #endif -typedef uint16_t char16_t; +#if __STDC_VERSION__ < 201112L && __cplusplus < 201103L + typedef uint16_t char16_t; +#endif + // otherwise char16_t is a keyword with the right semantics extern char * strndup16to8 (const char16_t* s, size_t n); extern size_t strnlen16to8 (const char16_t* s, size_t n);