]> granicus.if.org Git - icu/commit
ICU-20904 Don't use char16_t with C++98/03
authorJoshua Root <jmr@macports.org>
Fri, 22 Nov 2019 10:44:57 +0000 (21:44 +1100)
committerJeff Genovy <29107334+jefgen@users.noreply.github.com>
Thu, 12 Dec 2019 02:41:27 +0000 (18:41 -0800)
commitc6fd07cdecce8fc3a517258d5145e89cd2781a9b
treedf821d6faa4ced426469e231d5933b3cf9f0a8ed
parent619648e24ebd41cfbd67c22ae0b8893ee84be03b
ICU-20904 Don't use char16_t with C++98/03

When C code includes the ICU headers, the UChar type is defined to be
uint16_t. But when C++ code includes the headers, UChar is char16_t
even when U_SHOW_CPLUSPLUS_API has been set to 0. Apart from arguably
being an inconsistency in the API, this means that C++98 or C++03 code
can't use the C API even though C99 code can.

So, change unicode/umachine.h to check not just whether __cplusplus is
defined but the value of U_CPLUSPLUS_VERSION when deciding how to
typedef UChar.
icu4c/source/common/unicode/umachine.h