Skip to content

Commit 14fe00a

Browse files
committed
fixed stringconverter windows build
1 parent 7ef9579 commit 14fe00a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

libc/src/__support/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ add_subdirectory(time)
393393

394394
# Requires access to uchar header which is not on macos
395395
# Therefore, cannot currently build this on macos in overlay mode
396-
if(NOT (LIBC_TARGET_OS_IS_DARWIN OR LIBC_TARGET_OS_IS_WINDOWS))
396+
if(NOT (LIBC_TARGET_OS_IS_DARWIN))
397397
add_subdirectory(wchar)
398398
endif()
399399

libc/test/src/__support/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,6 @@ add_subdirectory(time)
277277
add_subdirectory(threads)
278278
# Requires access to uchar header which is not on MacOS
279279
# Cannot currently build this on MacOS in overlay mode
280-
if(NOT (LIBC_TARGET_OS_IS_DARWIN OR LIBC_TARGET_OS_IS_WINDOWS))
280+
if(NOT (LIBC_TARGET_OS_IS_DARWIN))
281281
add_subdirectory(wchar)
282282
endif()

libc/test/src/__support/wchar/string_converter_test.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ TEST(LlvmLibcStringConverterTest, UTF8To32) {
5757

5858
TEST(LlvmLibcStringConverterTest, UTF32To8) {
5959
// clown emoji, sigma symbol, y with diaeresis, letter A
60-
const wchar_t *src = L"\x1f921\x2211\xff\x41";
60+
const wchar_t src[] = {0x1f921, 0x2211, 0xff, 0x41, 0x0};
6161
LIBC_NAMESPACE::internal::mbstate state;
6262
LIBC_NAMESPACE::internal::StringConverter<char32_t> sc(
6363
reinterpret_cast<const char32_t *>(src), &state, SIZE_MAX);
@@ -128,7 +128,7 @@ TEST(LlvmLibcStringConverterTest, UTF32To8) {
128128
}
129129

130130
TEST(LlvmLibcStringConverterTest, UTF32To8PartialRead) {
131-
const wchar_t *src = L"\x1f921\x2211"; // clown emoji, sigma symbol
131+
const wchar_t src[] = {0x1f921, 0x2211, 0x0}; // clown emoji, sigma symbol
132132
LIBC_NAMESPACE::internal::mbstate state;
133133
LIBC_NAMESPACE::internal::StringConverter<char32_t> sc(
134134
reinterpret_cast<const char32_t *>(src), &state, SIZE_MAX, 1);
@@ -178,7 +178,7 @@ TEST(LlvmLibcStringConverterTest, UTF8To32PartialRead) {
178178
}
179179

180180
TEST(LlvmLibcStringConverterTest, UTF32To8ErrorHandling) {
181-
const wchar_t *src = L"\x1f921\xffffff"; // clown emoji, invalid utf32
181+
const wchar_t src[] = {0x1f921, 0xffffff, 0x0}; // clown emoji, invalid utf32
182182
LIBC_NAMESPACE::internal::mbstate state;
183183
LIBC_NAMESPACE::internal::StringConverter<char32_t> sc(
184184
reinterpret_cast<const char32_t *>(src), &state, SIZE_MAX);
@@ -234,7 +234,7 @@ TEST(LlvmLibcStringConverterTest, MultipleStringConverters32To8) {
234234
StringConverter to continue where we left off. This is not expected to work
235235
and considered invalid.
236236
*/
237-
const wchar_t *src = L"\x1f921\xff"; // clown emoji, y with diaeresis (ÿ)
237+
const wchar_t src[] = {0x1f921, 0xff, 0x0}; // clown emoji, y with diaeresis (ÿ)
238238
LIBC_NAMESPACE::internal::mbstate state;
239239
LIBC_NAMESPACE::internal::StringConverter<char32_t> sc1(
240240
reinterpret_cast<const char32_t *>(src), &state, SIZE_MAX, 1);
@@ -317,7 +317,7 @@ TEST(LlvmLibcStringConverterTest, DestLimitUTF8To32) {
317317
}
318318

319319
TEST(LlvmLibcStringConverterTest, DestLimitUTF32To8) {
320-
const wchar_t *src = L"\x1f921\x1f921"; // 2 clown emojis
320+
const wchar_t src[] = {0x1f921, 0x1f921}; // 2 clown emojis
321321
LIBC_NAMESPACE::internal::mbstate state;
322322
LIBC_NAMESPACE::internal::StringConverter<char32_t> sc(
323323
reinterpret_cast<const char32_t *>(src), &state, 5);

0 commit comments

Comments
 (0)