[libcxx-commits] [clang] [libcxx] [libc++] Rename `__` prefix to `__libcpp_` for locale related functions (PR #119241)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Dec 9 10:20:40 PST 2024
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 788d5a5f1e1263657f0a281545e095769f6b375b d3ee5e960bbf20286d726135423eb632ae45eafb --extensions ,h,cpp -- clang/lib/Headers/zos_wrappers/locale.h libcxx/include/__locale_dir/locale_base_api.h libcxx/include/__locale_dir/locale_base_api/ibm.h libcxx/include/locale libcxx/src/locale.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Headers/zos_wrappers/locale.h b/clang/lib/Headers/zos_wrappers/locale.h
index 1381f6d47a..fb6f5c30bc 100644
--- a/clang/lib/Headers/zos_wrappers/locale.h
+++ b/clang/lib/Headers/zos_wrappers/locale.h
@@ -1,4 +1,5 @@
-/*===----------------------------- locale.h ----------------------------------===
+/*===----------------------------- locale.h
+ *----------------------------------===
*
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
* See https://llvm.org/LICENSE.txt for license information.
@@ -9,11 +10,11 @@
#ifndef __ZOS_WRAPPERS_LOCALE_H
#define __ZOS_WRAPPERS_LOCALE_H
- #if defined(__MVS__)
- #include_next <locale.h>
- #ifdef __locale
- #undef __locale
- #define __locale __locale
- #endif
- #endif /* defined(__MVS__) */
+#if defined(__MVS__)
+#include_next <locale.h>
+#ifdef __locale
+#undef __locale
+#define __locale __locale
+#endif
+#endif /* defined(__MVS__) */
#endif /* __ZOS_WRAPPERS_LOCALE_H */
diff --git a/libcxx/include/__locale_dir/locale_base_api.h b/libcxx/include/__locale_dir/locale_base_api.h
index 9bd3420b65..a75f6dbf15 100644
--- a/libcxx/include/__locale_dir/locale_base_api.h
+++ b/libcxx/include/__locale_dir/locale_base_api.h
@@ -166,7 +166,8 @@ inline _LIBCPP_HIDE_FROM_ABI long double __libcpp_strtold(const char* __nptr, ch
return strtold_l(__nptr, __endptr, __loc);
}
-inline _LIBCPP_HIDE_FROM_ABI long long __libcpp_strtoll(const char* __nptr, char** __endptr, int __base, __locale_t __loc) {
+inline _LIBCPP_HIDE_FROM_ABI long long
+__libcpp_strtoll(const char* __nptr, char** __endptr, int __base, __locale_t __loc) {
return strtoll_l(__nptr, __endptr, __base, __loc);
}
@@ -175,9 +176,9 @@ __libcpp_strtoull(const char* __nptr, char** __endptr, int __base, __locale_t __
return strtoull_l(__nptr, __endptr, __base, __loc);
}
-# if defined(__MVS__)
+# if defined(__MVS__)
using namespace __ibm;
-# endif
+# endif
//
// Character manipulation functions
@@ -199,7 +200,8 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_tolower(int __ch, __locale_t __loc) {
inline _LIBCPP_HIDE_FROM_ABI int __libcpp_wcscoll(const wchar_t* __s1, const wchar_t* __s2, __locale_t __loc) {
return wcscoll_l(__s1, __s2, __loc);
}
-inline _LIBCPP_HIDE_FROM_ABI size_t __libcpp_wcsxfrm(wchar_t* __dest, const wchar_t* __src, size_t __n, __locale_t __loc) {
+inline _LIBCPP_HIDE_FROM_ABI size_t
+__libcpp_wcsxfrm(wchar_t* __dest, const wchar_t* __src, size_t __n, __locale_t __loc) {
return wcsxfrm_l(__dest, __src, __n, __loc);
}
inline _LIBCPP_HIDE_FROM_ABI int __libcpp_iswspace(wint_t __ch, __locale_t __loc) { return iswspace_l(__ch, __loc); }
diff --git a/libcxx/include/__locale_dir/locale_base_api/ibm.h b/libcxx/include/__locale_dir/locale_base_api/ibm.h
index 4d4b1e3d38..9fbd9a8e53 100644
--- a/libcxx/include/__locale_dir/locale_base_api/ibm.h
+++ b/libcxx/include/__locale_dir/locale_base_api/ibm.h
@@ -132,10 +132,10 @@ _LIBCPP_EXPORTED_FROM_ABI int toupper_l(int, locale_t);
_LIBCPP_EXPORTED_FROM_ABI int tolower_l(int, locale_t);
_LIBCPP_EXPORTED_FROM_ABI wint_t towupper_l(wint_t, locale_t);
_LIBCPP_EXPORTED_FROM_ABI wint_t towlower_l(wint_t, locale_t);
-_LIBCPP_EXPORTED_FROM_ABI int strcoll_l(const char *, const char *, locale_t);
-_LIBCPP_EXPORTED_FROM_ABI size_t strxfrm_l(char *, const char *, size_t, locale_t);
-_LIBCPP_EXPORTED_FROM_ABI size_t strftime_l(char *, size_t , const char *, const struct tm *, locale_t);
-_LIBCPP_EXPORTED_FROM_ABI int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
-_LIBCPP_EXPORTED_FROM_ABI size_t wcsxfrm_l(wchar_t *, const wchar_t *, size_t , locale_t);
-}
+_LIBCPP_EXPORTED_FROM_ABI int strcoll_l(const char*, const char*, locale_t);
+_LIBCPP_EXPORTED_FROM_ABI size_t strxfrm_l(char*, const char*, size_t, locale_t);
+_LIBCPP_EXPORTED_FROM_ABI size_t strftime_l(char*, size_t, const char*, const struct tm*, locale_t);
+_LIBCPP_EXPORTED_FROM_ABI int wcscoll_l(const wchar_t*, const wchar_t*, locale_t);
+_LIBCPP_EXPORTED_FROM_ABI size_t wcsxfrm_l(wchar_t*, const wchar_t*, size_t, locale_t);
+} // namespace __ibm
#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_IBM_H
``````````
</details>
https://github.com/llvm/llvm-project/pull/119241
More information about the libcxx-commits
mailing list