From c47318491439642ed47cb9c9098333a8199fa54a Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 20 Nov 2020 21:48:40 -0500 Subject: [PATCH] [mac/arm] Fix clang/test/Sema/wchar.c on mac/arm hosts Part of PR46644. --- clang/test/Sema/wchar.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/clang/test/Sema/wchar.c b/clang/test/Sema/wchar.c index 3170e363ff77..83ea6372168d 100644 --- a/clang/test/Sema/wchar.c +++ b/clang/test/Sema/wchar.c @@ -6,7 +6,14 @@ typedef __WCHAR_TYPE__ wchar_t; #if defined(_WIN32) || defined(_M_IX86) || defined(__CYGWIN__) \ || defined(_M_X64) || defined(__ORBIS__) || defined(SHORT_WCHAR) #define WCHAR_T_TYPE unsigned short -#elif defined(__arm) || defined(__aarch64__) || defined(__MVS__) +#elif defined(__aarch64__) + // See AArch64TargetInfo constructor -- unsigned on non-darwin non-OpenBSD non-NetBSD. + #if defined(__OpenBSD__) || defined(__APPLE__) || defined(__NetBSD__) + #define WCHAR_T_TYPE int + #else + #define WCHAR_T_TYPE unsigned int + #endif +#elif defined(__arm) || defined(__MVS__) #define WCHAR_T_TYPE unsigned int #elif defined(__sun) #if defined(__LP64__) @@ -14,7 +21,7 @@ typedef __WCHAR_TYPE__ wchar_t; #else #define WCHAR_T_TYPE long #endif -#else /* Solaris. */ +#else /* Solaris, Linux, non-arm64 macOS, ... */ #define WCHAR_T_TYPE int #endif