We're updating the issue view to help you get more done. 

configure fails to detect C UTF-16 literals

Description

1 2 3 4 5 6 7 8 9 ... checking wchar.h usability... yes checking wchar.h presence... yes checking for wchar.h... yes checking for library containing wcscpy... none required checking size of wchar_t... 4 checking for UTF-16 string literal support... C++ only checking for a library suffix to use... none ...

http://gcc.gnu.org/gcc-4.4/changes.html says:
"New character data types, per TR 19769: New character types in C, are now supported for the C compiler in -std=gnu99 mode, as `_CHAR16_TYPE` and `CHAR32_TYPE_`, and for the C++ compiler in -std=c+0x and -std=gnu+0x modes, as char16 ([ICU-unknown])_t and char32 ()_t too."

The following patch fixes detection of C UTF-16 literals:

1 2 3 4 5 6 7 8 9 10 11 --- configure.in +++ configure.in @@ -961,7 +961,7 @@ OLD_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} -std=gnu99" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -static const char16_t test[] = u"This is a UTF16 literal string."; +static const __CHAR16_TYPE__ test[] = u"This is a UTF16 literal string."; ]], [[]])],[CC_UTF16_STRING=1],[CC_UTF16_STRING=0]) if test "$CC_UTF16_STRING" = 1; then CHECK_UTF16_STRING_RESULT="C only";

Status

Assignee

Andy Heninger

Reporter

TracBot

Labels

None

Reviewer

None

Time Needed

Hours

Start date

None

Components

Fix versions

Priority

major