[libcxx-commits] [libcxx] [AIX][libc++] Fix redefinition of wchar_t overloads on AIX (PR #201432)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jun 3 12:00:15 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h -- libcxx/include/wchar.h --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/wchar.h b/libcxx/include/wchar.h
index 8f652fee8..3f0710623 100644
--- a/libcxx/include/wchar.h
+++ b/libcxx/include/wchar.h
@@ -137,7 +137,7 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
# if _LIBCPP_HAS_WIDE_CHARACTERS
# if defined(__cplusplus) && !defined(_LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS) && defined(_LIBCPP_PREFERRED_OVERLOAD)
-# if defined(_AIX) && !defined(_LIBCPP_WCHAR_H_OVERLOADS)
+# if defined(_AIX) && !defined(_LIBCPP_WCHAR_H_OVERLOADS)
extern "C++" {
inline _LIBCPP_HIDE_FROM_ABI wchar_t* __libcpp_wcschr(const wchar_t* __s, wchar_t __c) {
return (wchar_t*)wcschr(__s, __c);
@@ -192,16 +192,16 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD wchar_t* wmemchr(wchar_t
return __libcpp_wmemchr(__s, __c, __n);
}
}
-# endif
+# endif
-# if defined(__cplusplus) && (defined(_LIBCPP_MSVCRT_LIKE) || defined(__MVS__))
+# if defined(__cplusplus) && (defined(_LIBCPP_MSVCRT_LIKE) || defined(__MVS__))
extern "C" {
size_t mbsnrtowcs(
wchar_t* __restrict __dst, const char** __restrict __src, size_t __nmc, size_t __len, mbstate_t* __restrict __ps);
size_t wcsnrtombs(
char* __restrict __dst, const wchar_t** __restrict __src, size_t __nwc, size_t __len, mbstate_t* __restrict __ps);
} // extern "C"
-# endif // _LIBCPP_WCHAR_H_OVERLOADS
+# endif // _LIBCPP_WCHAR_H_OVERLOADS
# endif // __cplusplus && (_LIBCPP_MSVCRT || __MVS__)
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
# endif // _LIBCPP_WCHAR_H
``````````
</details>
https://github.com/llvm/llvm-project/pull/201432
More information about the libcxx-commits
mailing list