aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/wchar.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-12-25 17:35:41 +0000
committerDimitry Andric <dim@FreeBSD.org>2024-04-06 20:13:06 +0000
commitcb14a3fe5122c879eae1fb480ed7ce82a699ddb6 (patch)
treeb983a613c35ece61d561b5a9ef9cd66419f6c7fb /contrib/llvm-project/libcxx/include/wchar.h
parent3d68ee6cbdb244de9fab1df8a2525d2fa592571e (diff)
parent99aabd70801bd4bc72c4942747f6d62c675112f5 (diff)
downloadsrc-cb14a3fe5122c879eae1fb480ed7ce82a699ddb6.tar.gz
src-cb14a3fe5122c879eae1fb480ed7ce82a699ddb6.zip
Merge llvm-project main llvmorg-18-init-15692-g007ed0dccd6a
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-18-init-15692-g007ed0dccd6a. PR: 276104 MFC after: 1 month
Diffstat (limited to 'contrib/llvm-project/libcxx/include/wchar.h')
-rw-r--r--contrib/llvm-project/libcxx/include/wchar.h157
1 files changed, 88 insertions, 69 deletions
diff --git a/contrib/llvm-project/libcxx/include/wchar.h b/contrib/llvm-project/libcxx/include/wchar.h
index 41fe40db06f9..d4268c6d2c24 100644
--- a/contrib/llvm-project/libcxx/include/wchar.h
+++ b/contrib/llvm-project/libcxx/include/wchar.h
@@ -9,14 +9,14 @@
#if defined(__need_wint_t) || defined(__need_mbstate_t)
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
+# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+# endif
-#include_next <wchar.h>
+# include_next <wchar.h>
#elif !defined(_LIBCPP_WCHAR_H)
-#define _LIBCPP_WCHAR_H
+# define _LIBCPP_WCHAR_H
/*
wchar.h synopsis
@@ -105,22 +105,23 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
*/
-#include <__config>
-#include <stddef.h>
+# include <__config>
+# include <stddef.h>
-#if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
-# error "The <wchar.h> header is not supported since libc++ has been configured with LIBCXX_ENABLE_WIDE_CHARACTERS disabled"
-#endif
+# if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
+# error \
+ "The <wchar.h> header is not supported since libc++ has been configured with LIBCXX_ENABLE_WIDE_CHARACTERS disabled"
+# endif
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
+# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+# endif
// We define this here to support older versions of glibc <wchar.h> that do
// not define this for clang.
-#ifdef __cplusplus
-#define __CORRECT_ISO_CPP_WCHAR_H_PROTO
-#endif
+# ifdef __cplusplus
+# define __CORRECT_ISO_CPP_WCHAR_H_PROTO
+# endif
# if __has_include_next(<wchar.h>)
# include_next <wchar.h>
@@ -129,64 +130,82 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
# endif
// Determine whether we have const-correct overloads for wcschr and friends.
-#if defined(_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_)
-# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
-#elif defined(__GLIBC_PREREQ)
-# if __GLIBC_PREREQ(2, 10)
+# if defined(_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_)
# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
+# elif defined(__GLIBC_PREREQ)
+# if __GLIBC_PREREQ(2, 10)
+# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
+# endif
+# elif defined(_LIBCPP_MSVCRT)
+# if defined(_CRT_CONST_CORRECT_OVERLOADS)
+# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
+# endif
# endif
-#elif defined(_LIBCPP_MSVCRT)
-# if defined(_CRT_CONST_CORRECT_OVERLOADS)
-# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
-# endif
-#endif
-#if defined(__cplusplus) && !defined(_LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS) && defined(_LIBCPP_PREFERRED_OVERLOAD)
+# if defined(__cplusplus) && !defined(_LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS) && defined(_LIBCPP_PREFERRED_OVERLOAD)
extern "C++" {
-inline _LIBCPP_HIDE_FROM_ABI
-wchar_t* __libcpp_wcschr(const wchar_t* __s, wchar_t __c) {return (wchar_t*)wcschr(__s, __c);}
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD
-const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);}
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD
- wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);}
-
-inline _LIBCPP_HIDE_FROM_ABI
-wchar_t* __libcpp_wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcspbrk(__s1, __s2);}
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD
-const wchar_t* wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcspbrk(__s1, __s2);}
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD
- wchar_t* wcspbrk( wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcspbrk(__s1, __s2);}
-
-inline _LIBCPP_HIDE_FROM_ABI
-wchar_t* __libcpp_wcsrchr(const wchar_t* __s, wchar_t __c) {return (wchar_t*)wcsrchr(__s, __c);}
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD
-const wchar_t* wcsrchr(const wchar_t* __s, wchar_t __c) {return __libcpp_wcsrchr(__s, __c);}
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD
- wchar_t* wcsrchr( wchar_t* __s, wchar_t __c) {return __libcpp_wcsrchr(__s, __c);}
-
-inline _LIBCPP_HIDE_FROM_ABI
-wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcsstr(__s1, __s2);}
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD
-const wchar_t* wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcsstr(__s1, __s2);}
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD
- wchar_t* wcsstr( wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcsstr(__s1, __s2);}
-
-inline _LIBCPP_HIDE_FROM_ABI
-wchar_t* __libcpp_wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return (wchar_t*)wmemchr(__s, __c, __n);}
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD
-const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return __libcpp_wmemchr(__s, __c, __n);}
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD
- wchar_t* wmemchr( wchar_t* __s, wchar_t __c, size_t __n) {return __libcpp_wmemchr(__s, __c, __n);}
-}
-#endif
-
-#if defined(__cplusplus) && (defined(_LIBCPP_MSVCRT_LIKE) || defined(__MVS__))
+inline _LIBCPP_HIDE_FROM_ABI wchar_t* __libcpp_wcschr(const wchar_t* __s, wchar_t __c) {
+ return (wchar_t*)wcschr(__s, __c);
+}
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {
+ return __libcpp_wcschr(__s, __c);
+}
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD wchar_t* wcschr(wchar_t* __s, wchar_t __c) {
+ return __libcpp_wcschr(__s, __c);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI wchar_t* __libcpp_wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {
+ return (wchar_t*)wcspbrk(__s1, __s2);
+}
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const wchar_t*
+wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {
+ return __libcpp_wcspbrk(__s1, __s2);
+}
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD wchar_t* wcspbrk(wchar_t* __s1, const wchar_t* __s2) {
+ return __libcpp_wcspbrk(__s1, __s2);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI wchar_t* __libcpp_wcsrchr(const wchar_t* __s, wchar_t __c) {
+ return (wchar_t*)wcsrchr(__s, __c);
+}
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const wchar_t* wcsrchr(const wchar_t* __s, wchar_t __c) {
+ return __libcpp_wcsrchr(__s, __c);
+}
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD wchar_t* wcsrchr(wchar_t* __s, wchar_t __c) {
+ return __libcpp_wcsrchr(__s, __c);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) {
+ return (wchar_t*)wcsstr(__s1, __s2);
+}
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const wchar_t*
+wcsstr(const wchar_t* __s1, const wchar_t* __s2) {
+ return __libcpp_wcsstr(__s1, __s2);
+}
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD wchar_t* wcsstr(wchar_t* __s1, const wchar_t* __s2) {
+ return __libcpp_wcsstr(__s1, __s2);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI wchar_t* __libcpp_wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {
+ return (wchar_t*)wmemchr(__s, __c, __n);
+}
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const wchar_t*
+wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {
+ return __libcpp_wmemchr(__s, __c, __n);
+}
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD wchar_t* wmemchr(wchar_t* __s, wchar_t __c, size_t __n) {
+ return __libcpp_wmemchr(__s, __c, __n);
+}
+}
+# endif
+
+# 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);
+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 // __cplusplus && (_LIBCPP_MSVCRT || __MVS__)
+# endif // __cplusplus && (_LIBCPP_MSVCRT || __MVS__)
#endif // _LIBCPP_WCHAR_H