Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / include / wctype.h
blobe4dc61ad5cf479df7649c60ea19c03247f449d80
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP_WCTYPE_H
11 #define _LIBCPP_WCTYPE_H
14 wctype.h synopsis
16 Macros:
18 WEOF
20 Types:
22 wint_t
23 wctrans_t
24 wctype_t
26 int iswalnum(wint_t wc);
27 int iswalpha(wint_t wc);
28 int iswblank(wint_t wc); // C99
29 int iswcntrl(wint_t wc);
30 int iswdigit(wint_t wc);
31 int iswgraph(wint_t wc);
32 int iswlower(wint_t wc);
33 int iswprint(wint_t wc);
34 int iswpunct(wint_t wc);
35 int iswspace(wint_t wc);
36 int iswupper(wint_t wc);
37 int iswxdigit(wint_t wc);
38 int iswctype(wint_t wc, wctype_t desc);
39 wctype_t wctype(const char* property);
40 wint_t towlower(wint_t wc);
41 wint_t towupper(wint_t wc);
42 wint_t towctrans(wint_t wc, wctrans_t desc);
43 wctrans_t wctrans(const char* property);
47 #include <__config>
49 #if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
50 # error "The <wctype.h> header is not supported since libc++ has been configured with LIBCXX_ENABLE_WIDE_CHARACTERS disabled"
51 #endif
53 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
54 # pragma GCC system_header
55 #endif
57 // TODO:
58 // In the future, we should unconditionally include_next <wctype.h> here and instead
59 // have a mode under which the library does not need libc++'s <wctype.h> or <cwctype>
60 // at all (i.e. a mode without wchar_t). As it stands, we need to do that to completely
61 // bypass the using declarations in <cwctype> when we did not include <wctype.h>.
62 // Otherwise, a using declaration like `using ::wint_t` in <cwctype> will refer to
63 // nothing (with using_if_exists), and if we include another header that defines one
64 // of these declarations (e.g. <wchar.h>), the second `using ::wint_t` with using_if_exists
65 // will fail because it does not refer to the same declaration.
66 #if __has_include_next(<wctype.h>)
67 # include_next <wctype.h>
68 # define _LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H
69 #endif
71 #ifdef __cplusplus
73 #undef iswalnum
74 #undef iswalpha
75 #undef iswblank
76 #undef iswcntrl
77 #undef iswdigit
78 #undef iswgraph
79 #undef iswlower
80 #undef iswprint
81 #undef iswpunct
82 #undef iswspace
83 #undef iswupper
84 #undef iswxdigit
85 #undef iswctype
86 #undef wctype
87 #undef towlower
88 #undef towupper
89 #undef towctrans
90 #undef wctrans
92 #endif // __cplusplus
94 #endif // _LIBCPP_WCTYPE_H