From a9c9183ca42629fa83cdda297d1d30c7bc1d7c91 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Wed, 2 Jun 2021 10:41:37 -0400 Subject: [PATCH] [libc++] Use the using_if_exists attribute when provided As discussed on cfe-dev [1], use the using_if_exists Clang attribute when the compiler supports it. This makes it easier to port libc++ on top of new platforms that don't fully support the C Standard library. Previously, libc++ would fail to build when trying to import a missing declaration in a header. With the attribute, the declaration will simply not be imported into namespace std, and hence it won't be available for libc++ to use. In many cases, the declarations were *not* actually required for libc++ to work (they were only surfaced for users to use them as std::XXXX), so not importing them into namespace std is acceptable. The same thing could be achieved by conscious usage of `#ifdef` along with platform detection, however that quickly creates a maintenance problem as libc++ is ported to new platforms. Furthermore, this problem is exacerbated when mixed with vendor internal-only platforms, which can lead to difficulties maintaining a downstream fork of the library. For the time being, we only use the using_if_exists attribute when it is supported. At some point in the future, we will start removing #ifdef paths that are unnecessary when the attribute is supported, and folks who need those #ifdef paths will be required to use a compiler that supports the attribute. [1]: http://lists.llvm.org/pipermail/cfe-dev/2020-June/066038.html Differential Revision: https://reviews.llvm.org/D90257 --- libcxx/include/__config | 6 + libcxx/include/cctype | 28 +-- libcxx/include/cfenv | 28 +-- libcxx/include/cinttypes | 14 +- libcxx/include/clocale | 6 +- libcxx/include/cmath | 418 +++++++++++++++++++-------------------- libcxx/include/csetjmp | 4 +- libcxx/include/csignal | 6 +- libcxx/include/cstdarg | 2 +- libcxx/include/cstddef | 6 +- libcxx/include/cstdint | 70 +++---- libcxx/include/cstdio | 100 +++++----- libcxx/include/cstdlib | 86 ++++---- libcxx/include/cstring | 46 ++--- libcxx/include/ctime | 30 +-- libcxx/include/cwchar | 128 ++++++------ libcxx/include/cwctype | 42 ++-- 17 files changed, 513 insertions(+), 507 deletions(-) diff --git a/libcxx/include/__config b/libcxx/include/__config index 855b850ba10799..aa4579616feefa 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -880,6 +880,12 @@ typedef unsigned int char32_t; # define _LIBCPP_EXPLICIT #endif +#if __has_attribute(using_if_exists) +# define _LIBCPP_USING_IF_EXISTS __attribute__((using_if_exists)) +#else +# define _LIBCPP_USING_IF_EXISTS +#endif + #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS # define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx # define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \ diff --git a/libcxx/include/cctype b/libcxx/include/cctype index 3b06928c41f7b5..b078056862a7be 100644 --- a/libcxx/include/cctype +++ b/libcxx/include/cctype @@ -100,20 +100,20 @@ _LIBCPP_BEGIN_NAMESPACE_STD #endif -using ::isalnum; -using ::isalpha; -using ::isblank; -using ::iscntrl; -using ::isdigit; -using ::isgraph; -using ::islower; -using ::isprint; -using ::ispunct; -using ::isspace; -using ::isupper; -using ::isxdigit; -using ::tolower; -using ::toupper; +using ::isalnum _LIBCPP_USING_IF_EXISTS; +using ::isalpha _LIBCPP_USING_IF_EXISTS; +using ::isblank _LIBCPP_USING_IF_EXISTS; +using ::iscntrl _LIBCPP_USING_IF_EXISTS; +using ::isdigit _LIBCPP_USING_IF_EXISTS; +using ::isgraph _LIBCPP_USING_IF_EXISTS; +using ::islower _LIBCPP_USING_IF_EXISTS; +using ::isprint _LIBCPP_USING_IF_EXISTS; +using ::ispunct _LIBCPP_USING_IF_EXISTS; +using ::isspace _LIBCPP_USING_IF_EXISTS; +using ::isupper _LIBCPP_USING_IF_EXISTS; +using ::isxdigit _LIBCPP_USING_IF_EXISTS; +using ::tolower _LIBCPP_USING_IF_EXISTS; +using ::toupper _LIBCPP_USING_IF_EXISTS; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/cfenv b/libcxx/include/cfenv index 4da04d3b282a00..05b55ee364f28c 100644 --- a/libcxx/include/cfenv +++ b/libcxx/include/cfenv @@ -61,20 +61,20 @@ int feupdateenv(const fenv_t* envp); _LIBCPP_BEGIN_NAMESPACE_STD -using ::fenv_t; -using ::fexcept_t; - -using ::feclearexcept; -using ::fegetexceptflag; -using ::feraiseexcept; -using ::fesetexceptflag; -using ::fetestexcept; -using ::fegetround; -using ::fesetround; -using ::fegetenv; -using ::feholdexcept; -using ::fesetenv; -using ::feupdateenv; +using ::fenv_t _LIBCPP_USING_IF_EXISTS; +using ::fexcept_t _LIBCPP_USING_IF_EXISTS; + +using ::feclearexcept _LIBCPP_USING_IF_EXISTS; +using ::fegetexceptflag _LIBCPP_USING_IF_EXISTS; +using ::feraiseexcept _LIBCPP_USING_IF_EXISTS; +using ::fesetexceptflag _LIBCPP_USING_IF_EXISTS; +using ::fetestexcept _LIBCPP_USING_IF_EXISTS; +using ::fegetround _LIBCPP_USING_IF_EXISTS; +using ::fesetround _LIBCPP_USING_IF_EXISTS; +using ::fegetenv _LIBCPP_USING_IF_EXISTS; +using ::feholdexcept _LIBCPP_USING_IF_EXISTS; +using ::fesetenv _LIBCPP_USING_IF_EXISTS; +using ::feupdateenv _LIBCPP_USING_IF_EXISTS; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/cinttypes b/libcxx/include/cinttypes index 56fcf6383c24ba..7ce4a8ad5d80c8 100644 --- a/libcxx/include/cinttypes +++ b/libcxx/include/cinttypes @@ -244,13 +244,13 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int _LIBCPP_BEGIN_NAMESPACE_STD -using::imaxdiv_t; -using::imaxabs; -using::imaxdiv; -using::strtoimax; -using::strtoumax; -using::wcstoimax; -using::wcstoumax; +using ::imaxdiv_t _LIBCPP_USING_IF_EXISTS; +using ::imaxabs _LIBCPP_USING_IF_EXISTS; +using ::imaxdiv _LIBCPP_USING_IF_EXISTS; +using ::strtoimax _LIBCPP_USING_IF_EXISTS; +using ::strtoumax _LIBCPP_USING_IF_EXISTS; +using ::wcstoimax _LIBCPP_USING_IF_EXISTS; +using ::wcstoumax _LIBCPP_USING_IF_EXISTS; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/clocale b/libcxx/include/clocale index 06a529cafc1337..8fe91fc5a3a461 100644 --- a/libcxx/include/clocale +++ b/libcxx/include/clocale @@ -43,11 +43,11 @@ lconv* localeconv(); _LIBCPP_BEGIN_NAMESPACE_STD -using ::lconv; +using ::lconv _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS -using ::setlocale; +using ::setlocale _LIBCPP_USING_IF_EXISTS; #endif -using ::localeconv; +using ::localeconv _LIBCPP_USING_IF_EXISTS; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/cmath b/libcxx/include/cmath index 5f413666065ae4..a520685caa8d18 100644 --- a/libcxx/include/cmath +++ b/libcxx/include/cmath @@ -318,215 +318,215 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD -using ::signbit; -using ::fpclassify; -using ::isfinite; -using ::isinf; -using ::isnan; -using ::isnormal; -using ::isgreater; -using ::isgreaterequal; -using ::isless; -using ::islessequal; -using ::islessgreater; -using ::isunordered; -using ::isunordered; - -using ::float_t; -using ::double_t; - -using ::abs; - -using ::acos; -using ::acosf; -using ::asin; -using ::asinf; -using ::atan; -using ::atanf; -using ::atan2; -using ::atan2f; -using ::ceil; -using ::ceilf; -using ::cos; -using ::cosf; -using ::cosh; -using ::coshf; - -using ::exp; -using ::expf; - -using ::fabs; -using ::fabsf; -using ::floor; -using ::floorf; - -using ::fmod; -using ::fmodf; - -using ::frexp; -using ::frexpf; -using ::ldexp; -using ::ldexpf; - -using ::log; -using ::logf; - -using ::log10; -using ::log10f; -using ::modf; -using ::modff; - -using ::pow; -using ::powf; - -using ::sin; -using ::sinf; -using ::sinh; -using ::sinhf; - -using ::sqrt; -using ::sqrtf; -using ::tan; -using ::tanf; - -using ::tanh; -using ::tanhf; - -using ::acosh; -using ::acoshf; -using ::asinh; -using ::asinhf; -using ::atanh; -using ::atanhf; -using ::cbrt; -using ::cbrtf; - -using ::copysign; -using ::copysignf; - -using ::erf; -using ::erff; -using ::erfc; -using ::erfcf; -using ::exp2; -using ::exp2f; -using ::expm1; -using ::expm1f; -using ::fdim; -using ::fdimf; -using ::fmaf; -using ::fma; -using ::fmax; -using ::fmaxf; -using ::fmin; -using ::fminf; -using ::hypot; -using ::hypotf; -using ::ilogb; -using ::ilogbf; -using ::lgamma; -using ::lgammaf; -using ::llrint; -using ::llrintf; -using ::llround; -using ::llroundf; -using ::log1p; -using ::log1pf; -using ::log2; -using ::log2f; -using ::logb; -using ::logbf; -using ::lrint; -using ::lrintf; -using ::lround; -using ::lroundf; - -using ::nan; -using ::nanf; - -using ::nearbyint; -using ::nearbyintf; -using ::nextafter; -using ::nextafterf; -using ::nexttoward; -using ::nexttowardf; -using ::remainder; -using ::remainderf; -using ::remquo; -using ::remquof; -using ::rint; -using ::rintf; -using ::round; -using ::roundf; -using ::scalbln; -using ::scalblnf; -using ::scalbn; -using ::scalbnf; -using ::tgamma; -using ::tgammaf; -using ::trunc; -using ::truncf; - -using ::acosl; -using ::asinl; -using ::atanl; -using ::atan2l; -using ::ceill; -using ::cosl; -using ::coshl; -using ::expl; -using ::fabsl; -using ::floorl; -using ::fmodl; -using ::frexpl; -using ::ldexpl; -using ::logl; -using ::log10l; -using ::modfl; -using ::powl; -using ::sinl; -using ::sinhl; -using ::sqrtl; -using ::tanl; - -using ::tanhl; -using ::acoshl; -using ::asinhl; -using ::atanhl; -using ::cbrtl; - -using ::copysignl; - -using ::erfl; -using ::erfcl; -using ::exp2l; -using ::expm1l; -using ::fdiml; -using ::fmal; -using ::fmaxl; -using ::fminl; -using ::hypotl; -using ::ilogbl; -using ::lgammal; -using ::llrintl; -using ::llroundl; -using ::log1pl; -using ::log2l; -using ::logbl; -using ::lrintl; -using ::lroundl; -using ::nanl; -using ::nearbyintl; -using ::nextafterl; -using ::nexttowardl; -using ::remainderl; -using ::remquol; -using ::rintl; -using ::roundl; -using ::scalblnl; -using ::scalbnl; -using ::tgammal; -using ::truncl; +using ::signbit _LIBCPP_USING_IF_EXISTS; +using ::fpclassify _LIBCPP_USING_IF_EXISTS; +using ::isfinite _LIBCPP_USING_IF_EXISTS; +using ::isinf _LIBCPP_USING_IF_EXISTS; +using ::isnan _LIBCPP_USING_IF_EXISTS; +using ::isnormal _LIBCPP_USING_IF_EXISTS; +using ::isgreater _LIBCPP_USING_IF_EXISTS; +using ::isgreaterequal _LIBCPP_USING_IF_EXISTS; +using ::isless _LIBCPP_USING_IF_EXISTS; +using ::islessequal _LIBCPP_USING_IF_EXISTS; +using ::islessgreater _LIBCPP_USING_IF_EXISTS; +using ::isunordered _LIBCPP_USING_IF_EXISTS; +using ::isunordered _LIBCPP_USING_IF_EXISTS; + +using ::float_t _LIBCPP_USING_IF_EXISTS; +using ::double_t _LIBCPP_USING_IF_EXISTS; + +using ::abs _LIBCPP_USING_IF_EXISTS; + +using ::acos _LIBCPP_USING_IF_EXISTS; +using ::acosf _LIBCPP_USING_IF_EXISTS; +using ::asin _LIBCPP_USING_IF_EXISTS; +using ::asinf _LIBCPP_USING_IF_EXISTS; +using ::atan _LIBCPP_USING_IF_EXISTS; +using ::atanf _LIBCPP_USING_IF_EXISTS; +using ::atan2 _LIBCPP_USING_IF_EXISTS; +using ::atan2f _LIBCPP_USING_IF_EXISTS; +using ::ceil _LIBCPP_USING_IF_EXISTS; +using ::ceilf _LIBCPP_USING_IF_EXISTS; +using ::cos _LIBCPP_USING_IF_EXISTS; +using ::cosf _LIBCPP_USING_IF_EXISTS; +using ::cosh _LIBCPP_USING_IF_EXISTS; +using ::coshf _LIBCPP_USING_IF_EXISTS; + +using ::exp _LIBCPP_USING_IF_EXISTS; +using ::expf _LIBCPP_USING_IF_EXISTS; + +using ::fabs _LIBCPP_USING_IF_EXISTS; +using ::fabsf _LIBCPP_USING_IF_EXISTS; +using ::floor _LIBCPP_USING_IF_EXISTS; +using ::floorf _LIBCPP_USING_IF_EXISTS; + +using ::fmod _LIBCPP_USING_IF_EXISTS; +using ::fmodf _LIBCPP_USING_IF_EXISTS; + +using ::frexp _LIBCPP_USING_IF_EXISTS; +using ::frexpf _LIBCPP_USING_IF_EXISTS; +using ::ldexp _LIBCPP_USING_IF_EXISTS; +using ::ldexpf _LIBCPP_USING_IF_EXISTS; + +using ::log _LIBCPP_USING_IF_EXISTS; +using ::logf _LIBCPP_USING_IF_EXISTS; + +using ::log10 _LIBCPP_USING_IF_EXISTS; +using ::log10f _LIBCPP_USING_IF_EXISTS; +using ::modf _LIBCPP_USING_IF_EXISTS; +using ::modff _LIBCPP_USING_IF_EXISTS; + +using ::pow _LIBCPP_USING_IF_EXISTS; +using ::powf _LIBCPP_USING_IF_EXISTS; + +using ::sin _LIBCPP_USING_IF_EXISTS; +using ::sinf _LIBCPP_USING_IF_EXISTS; +using ::sinh _LIBCPP_USING_IF_EXISTS; +using ::sinhf _LIBCPP_USING_IF_EXISTS; + +using ::sqrt _LIBCPP_USING_IF_EXISTS; +using ::sqrtf _LIBCPP_USING_IF_EXISTS; +using ::tan _LIBCPP_USING_IF_EXISTS; +using ::tanf _LIBCPP_USING_IF_EXISTS; + +using ::tanh _LIBCPP_USING_IF_EXISTS; +using ::tanhf _LIBCPP_USING_IF_EXISTS; + +using ::acosh _LIBCPP_USING_IF_EXISTS; +using ::acoshf _LIBCPP_USING_IF_EXISTS; +using ::asinh _LIBCPP_USING_IF_EXISTS; +using ::asinhf _LIBCPP_USING_IF_EXISTS; +using ::atanh _LIBCPP_USING_IF_EXISTS; +using ::atanhf _LIBCPP_USING_IF_EXISTS; +using ::cbrt _LIBCPP_USING_IF_EXISTS; +using ::cbrtf _LIBCPP_USING_IF_EXISTS; + +using ::copysign _LIBCPP_USING_IF_EXISTS; +using ::copysignf _LIBCPP_USING_IF_EXISTS; + +using ::erf _LIBCPP_USING_IF_EXISTS; +using ::erff _LIBCPP_USING_IF_EXISTS; +using ::erfc _LIBCPP_USING_IF_EXISTS; +using ::erfcf _LIBCPP_USING_IF_EXISTS; +using ::exp2 _LIBCPP_USING_IF_EXISTS; +using ::exp2f _LIBCPP_USING_IF_EXISTS; +using ::expm1 _LIBCPP_USING_IF_EXISTS; +using ::expm1f _LIBCPP_USING_IF_EXISTS; +using ::fdim _LIBCPP_USING_IF_EXISTS; +using ::fdimf _LIBCPP_USING_IF_EXISTS; +using ::fmaf _LIBCPP_USING_IF_EXISTS; +using ::fma _LIBCPP_USING_IF_EXISTS; +using ::fmax _LIBCPP_USING_IF_EXISTS; +using ::fmaxf _LIBCPP_USING_IF_EXISTS; +using ::fmin _LIBCPP_USING_IF_EXISTS; +using ::fminf _LIBCPP_USING_IF_EXISTS; +using ::hypot _LIBCPP_USING_IF_EXISTS; +using ::hypotf _LIBCPP_USING_IF_EXISTS; +using ::ilogb _LIBCPP_USING_IF_EXISTS; +using ::ilogbf _LIBCPP_USING_IF_EXISTS; +using ::lgamma _LIBCPP_USING_IF_EXISTS; +using ::lgammaf _LIBCPP_USING_IF_EXISTS; +using ::llrint _LIBCPP_USING_IF_EXISTS; +using ::llrintf _LIBCPP_USING_IF_EXISTS; +using ::llround _LIBCPP_USING_IF_EXISTS; +using ::llroundf _LIBCPP_USING_IF_EXISTS; +using ::log1p _LIBCPP_USING_IF_EXISTS; +using ::log1pf _LIBCPP_USING_IF_EXISTS; +using ::log2 _LIBCPP_USING_IF_EXISTS; +using ::log2f _LIBCPP_USING_IF_EXISTS; +using ::logb _LIBCPP_USING_IF_EXISTS; +using ::logbf _LIBCPP_USING_IF_EXISTS; +using ::lrint _LIBCPP_USING_IF_EXISTS; +using ::lrintf _LIBCPP_USING_IF_EXISTS; +using ::lround _LIBCPP_USING_IF_EXISTS; +using ::lroundf _LIBCPP_USING_IF_EXISTS; + +using ::nan _LIBCPP_USING_IF_EXISTS; +using ::nanf _LIBCPP_USING_IF_EXISTS; + +using ::nearbyint _LIBCPP_USING_IF_EXISTS; +using ::nearbyintf _LIBCPP_USING_IF_EXISTS; +using ::nextafter _LIBCPP_USING_IF_EXISTS; +using ::nextafterf _LIBCPP_USING_IF_EXISTS; +using ::nexttoward _LIBCPP_USING_IF_EXISTS; +using ::nexttowardf _LIBCPP_USING_IF_EXISTS; +using ::remainder _LIBCPP_USING_IF_EXISTS; +using ::remainderf _LIBCPP_USING_IF_EXISTS; +using ::remquo _LIBCPP_USING_IF_EXISTS; +using ::remquof _LIBCPP_USING_IF_EXISTS; +using ::rint _LIBCPP_USING_IF_EXISTS; +using ::rintf _LIBCPP_USING_IF_EXISTS; +using ::round _LIBCPP_USING_IF_EXISTS; +using ::roundf _LIBCPP_USING_IF_EXISTS; +using ::scalbln _LIBCPP_USING_IF_EXISTS; +using ::scalblnf _LIBCPP_USING_IF_EXISTS; +using ::scalbn _LIBCPP_USING_IF_EXISTS; +using ::scalbnf _LIBCPP_USING_IF_EXISTS; +using ::tgamma _LIBCPP_USING_IF_EXISTS; +using ::tgammaf _LIBCPP_USING_IF_EXISTS; +using ::trunc _LIBCPP_USING_IF_EXISTS; +using ::truncf _LIBCPP_USING_IF_EXISTS; + +using ::acosl _LIBCPP_USING_IF_EXISTS; +using ::asinl _LIBCPP_USING_IF_EXISTS; +using ::atanl _LIBCPP_USING_IF_EXISTS; +using ::atan2l _LIBCPP_USING_IF_EXISTS; +using ::ceill _LIBCPP_USING_IF_EXISTS; +using ::cosl _LIBCPP_USING_IF_EXISTS; +using ::coshl _LIBCPP_USING_IF_EXISTS; +using ::expl _LIBCPP_USING_IF_EXISTS; +using ::fabsl _LIBCPP_USING_IF_EXISTS; +using ::floorl _LIBCPP_USING_IF_EXISTS; +using ::fmodl _LIBCPP_USING_IF_EXISTS; +using ::frexpl _LIBCPP_USING_IF_EXISTS; +using ::ldexpl _LIBCPP_USING_IF_EXISTS; +using ::logl _LIBCPP_USING_IF_EXISTS; +using ::log10l _LIBCPP_USING_IF_EXISTS; +using ::modfl _LIBCPP_USING_IF_EXISTS; +using ::powl _LIBCPP_USING_IF_EXISTS; +using ::sinl _LIBCPP_USING_IF_EXISTS; +using ::sinhl _LIBCPP_USING_IF_EXISTS; +using ::sqrtl _LIBCPP_USING_IF_EXISTS; +using ::tanl _LIBCPP_USING_IF_EXISTS; + +using ::tanhl _LIBCPP_USING_IF_EXISTS; +using ::acoshl _LIBCPP_USING_IF_EXISTS; +using ::asinhl _LIBCPP_USING_IF_EXISTS; +using ::atanhl _LIBCPP_USING_IF_EXISTS; +using ::cbrtl _LIBCPP_USING_IF_EXISTS; + +using ::copysignl _LIBCPP_USING_IF_EXISTS; + +using ::erfl _LIBCPP_USING_IF_EXISTS; +using ::erfcl _LIBCPP_USING_IF_EXISTS; +using ::exp2l _LIBCPP_USING_IF_EXISTS; +using ::expm1l _LIBCPP_USING_IF_EXISTS; +using ::fdiml _LIBCPP_USING_IF_EXISTS; +using ::fmal _LIBCPP_USING_IF_EXISTS; +using ::fmaxl _LIBCPP_USING_IF_EXISTS; +using ::fminl _LIBCPP_USING_IF_EXISTS; +using ::hypotl _LIBCPP_USING_IF_EXISTS; +using ::ilogbl _LIBCPP_USING_IF_EXISTS; +using ::lgammal _LIBCPP_USING_IF_EXISTS; +using ::llrintl _LIBCPP_USING_IF_EXISTS; +using ::llroundl _LIBCPP_USING_IF_EXISTS; +using ::log1pl _LIBCPP_USING_IF_EXISTS; +using ::log2l _LIBCPP_USING_IF_EXISTS; +using ::logbl _LIBCPP_USING_IF_EXISTS; +using ::lrintl _LIBCPP_USING_IF_EXISTS; +using ::lroundl _LIBCPP_USING_IF_EXISTS; +using ::nanl _LIBCPP_USING_IF_EXISTS; +using ::nearbyintl _LIBCPP_USING_IF_EXISTS; +using ::nextafterl _LIBCPP_USING_IF_EXISTS; +using ::nexttowardl _LIBCPP_USING_IF_EXISTS; +using ::remainderl _LIBCPP_USING_IF_EXISTS; +using ::remquol _LIBCPP_USING_IF_EXISTS; +using ::rintl _LIBCPP_USING_IF_EXISTS; +using ::roundl _LIBCPP_USING_IF_EXISTS; +using ::scalblnl _LIBCPP_USING_IF_EXISTS; +using ::scalbnl _LIBCPP_USING_IF_EXISTS; +using ::tgammal _LIBCPP_USING_IF_EXISTS; +using ::truncl _LIBCPP_USING_IF_EXISTS; #if _LIBCPP_STD_VER > 14 inline _LIBCPP_INLINE_VISIBILITY float hypot( float x, float y, float z ) { return sqrt(x*x + y*y + z*z); } diff --git a/libcxx/include/csetjmp b/libcxx/include/csetjmp index c360ce3bf65d01..41902f0e47103a 100644 --- a/libcxx/include/csetjmp +++ b/libcxx/include/csetjmp @@ -39,8 +39,8 @@ void longjmp(jmp_buf env, int val); _LIBCPP_BEGIN_NAMESPACE_STD -using ::jmp_buf; -using ::longjmp; +using ::jmp_buf _LIBCPP_USING_IF_EXISTS; +using ::longjmp _LIBCPP_USING_IF_EXISTS; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/csignal b/libcxx/include/csignal index 4cb070735f6982..3b262b561a403e 100644 --- a/libcxx/include/csignal +++ b/libcxx/include/csignal @@ -48,9 +48,9 @@ int raise(int sig); _LIBCPP_BEGIN_NAMESPACE_STD -using ::sig_atomic_t; -using ::signal; -using ::raise; +using ::sig_atomic_t _LIBCPP_USING_IF_EXISTS; +using ::signal _LIBCPP_USING_IF_EXISTS; +using ::raise _LIBCPP_USING_IF_EXISTS; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/cstdarg b/libcxx/include/cstdarg index da64667a7109ae..352db8b8c1dc7a 100644 --- a/libcxx/include/cstdarg +++ b/libcxx/include/cstdarg @@ -40,7 +40,7 @@ Types: _LIBCPP_BEGIN_NAMESPACE_STD -using ::va_list; +using ::va_list _LIBCPP_USING_IF_EXISTS; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/cstddef b/libcxx/include/cstddef index 0d7abcf22cef81..1b54e7b2e0dc84 100644 --- a/libcxx/include/cstddef +++ b/libcxx/include/cstddef @@ -46,11 +46,11 @@ Types: _LIBCPP_BEGIN_NAMESPACE_STD -using ::ptrdiff_t; -using ::size_t; +using ::ptrdiff_t _LIBCPP_USING_IF_EXISTS; +using ::size_t _LIBCPP_USING_IF_EXISTS; #if !defined(_LIBCPP_CXX03_LANG) -using ::max_align_t; +using ::max_align_t _LIBCPP_USING_IF_EXISTS; #endif template struct __libcpp_is_integral { enum { value = 0 }; }; diff --git a/libcxx/include/cstdint b/libcxx/include/cstdint index b3ba5536cb48ba..aa7c8b5cbf56c3 100644 --- a/libcxx/include/cstdint +++ b/libcxx/include/cstdint @@ -149,41 +149,41 @@ Types: _LIBCPP_BEGIN_NAMESPACE_STD -using::int8_t; -using::int16_t; -using::int32_t; -using::int64_t; - -using::uint8_t; -using::uint16_t; -using::uint32_t; -using::uint64_t; - -using::int_least8_t; -using::int_least16_t; -using::int_least32_t; -using::int_least64_t; - -using::uint_least8_t; -using::uint_least16_t; -using::uint_least32_t; -using::uint_least64_t; - -using::int_fast8_t; -using::int_fast16_t; -using::int_fast32_t; -using::int_fast64_t; - -using::uint_fast8_t; -using::uint_fast16_t; -using::uint_fast32_t; -using::uint_fast64_t; - -using::intptr_t; -using::uintptr_t; - -using::intmax_t; -using::uintmax_t; +using ::int8_t _LIBCPP_USING_IF_EXISTS; +using ::int16_t _LIBCPP_USING_IF_EXISTS; +using ::int32_t _LIBCPP_USING_IF_EXISTS; +using ::int64_t _LIBCPP_USING_IF_EXISTS; + +using ::uint8_t _LIBCPP_USING_IF_EXISTS; +using ::uint16_t _LIBCPP_USING_IF_EXISTS; +using ::uint32_t _LIBCPP_USING_IF_EXISTS; +using ::uint64_t _LIBCPP_USING_IF_EXISTS; + +using ::int_least8_t _LIBCPP_USING_IF_EXISTS; +using ::int_least16_t _LIBCPP_USING_IF_EXISTS; +using ::int_least32_t _LIBCPP_USING_IF_EXISTS; +using ::int_least64_t _LIBCPP_USING_IF_EXISTS; + +using ::uint_least8_t _LIBCPP_USING_IF_EXISTS; +using ::uint_least16_t _LIBCPP_USING_IF_EXISTS; +using ::uint_least32_t _LIBCPP_USING_IF_EXISTS; +using ::uint_least64_t _LIBCPP_USING_IF_EXISTS; + +using ::int_fast8_t _LIBCPP_USING_IF_EXISTS; +using ::int_fast16_t _LIBCPP_USING_IF_EXISTS; +using ::int_fast32_t _LIBCPP_USING_IF_EXISTS; +using ::int_fast64_t _LIBCPP_USING_IF_EXISTS; + +using ::uint_fast8_t _LIBCPP_USING_IF_EXISTS; +using ::uint_fast16_t _LIBCPP_USING_IF_EXISTS; +using ::uint_fast32_t _LIBCPP_USING_IF_EXISTS; +using ::uint_fast64_t _LIBCPP_USING_IF_EXISTS; + +using ::intptr_t _LIBCPP_USING_IF_EXISTS; +using ::uintptr_t _LIBCPP_USING_IF_EXISTS; + +using ::intmax_t _LIBCPP_USING_IF_EXISTS; +using ::uintmax_t _LIBCPP_USING_IF_EXISTS; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/cstdio b/libcxx/include/cstdio index 10705aa93404fd..b480f800a7b453 100644 --- a/libcxx/include/cstdio +++ b/libcxx/include/cstdio @@ -104,70 +104,70 @@ void perror(const char* s); _LIBCPP_BEGIN_NAMESPACE_STD -using ::FILE; -using ::fpos_t; -using ::size_t; - -using ::fclose; -using ::fflush; -using ::setbuf; -using ::setvbuf; -using ::fprintf; -using ::fscanf; -using ::snprintf; -using ::sprintf; -using ::sscanf; -using ::vfprintf; -using ::vfscanf; -using ::vsscanf; -using ::vsnprintf; -using ::vsprintf; -using ::fgetc; -using ::fgets; -using ::fputc; -using ::fputs; -using ::getc; -using ::putc; -using ::ungetc; -using ::fread; -using ::fwrite; +using ::FILE _LIBCPP_USING_IF_EXISTS; +using ::fpos_t _LIBCPP_USING_IF_EXISTS; +using ::size_t _LIBCPP_USING_IF_EXISTS; + +using ::fclose _LIBCPP_USING_IF_EXISTS; +using ::fflush _LIBCPP_USING_IF_EXISTS; +using ::setbuf _LIBCPP_USING_IF_EXISTS; +using ::setvbuf _LIBCPP_USING_IF_EXISTS; +using ::fprintf _LIBCPP_USING_IF_EXISTS; +using ::fscanf _LIBCPP_USING_IF_EXISTS; +using ::snprintf _LIBCPP_USING_IF_EXISTS; +using ::sprintf _LIBCPP_USING_IF_EXISTS; +using ::sscanf _LIBCPP_USING_IF_EXISTS; +using ::vfprintf _LIBCPP_USING_IF_EXISTS; +using ::vfscanf _LIBCPP_USING_IF_EXISTS; +using ::vsscanf _LIBCPP_USING_IF_EXISTS; +using ::vsnprintf _LIBCPP_USING_IF_EXISTS; +using ::vsprintf _LIBCPP_USING_IF_EXISTS; +using ::fgetc _LIBCPP_USING_IF_EXISTS; +using ::fgets _LIBCPP_USING_IF_EXISTS; +using ::fputc _LIBCPP_USING_IF_EXISTS; +using ::fputs _LIBCPP_USING_IF_EXISTS; +using ::getc _LIBCPP_USING_IF_EXISTS; +using ::putc _LIBCPP_USING_IF_EXISTS; +using ::ungetc _LIBCPP_USING_IF_EXISTS; +using ::fread _LIBCPP_USING_IF_EXISTS; +using ::fwrite _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS -using ::fgetpos; +using ::fgetpos _LIBCPP_USING_IF_EXISTS; #endif -using ::fseek; +using ::fseek _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS -using ::fsetpos; +using ::fsetpos _LIBCPP_USING_IF_EXISTS; #endif -using ::ftell; -using ::rewind; -using ::clearerr; -using ::feof; -using ::ferror; -using ::perror; +using ::ftell _LIBCPP_USING_IF_EXISTS; +using ::rewind _LIBCPP_USING_IF_EXISTS; +using ::clearerr _LIBCPP_USING_IF_EXISTS; +using ::feof _LIBCPP_USING_IF_EXISTS; +using ::ferror _LIBCPP_USING_IF_EXISTS; +using ::perror _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE -using ::fopen; -using ::freopen; -using ::remove; -using ::rename; -using ::tmpfile; -using ::tmpnam; +using ::fopen _LIBCPP_USING_IF_EXISTS; +using ::freopen _LIBCPP_USING_IF_EXISTS; +using ::remove _LIBCPP_USING_IF_EXISTS; +using ::rename _LIBCPP_USING_IF_EXISTS; +using ::tmpfile _LIBCPP_USING_IF_EXISTS; +using ::tmpnam _LIBCPP_USING_IF_EXISTS; #endif #ifndef _LIBCPP_HAS_NO_STDIN -using ::getchar; +using ::getchar _LIBCPP_USING_IF_EXISTS; #if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_C_HAS_NO_GETS) -using ::gets; +using ::gets _LIBCPP_USING_IF_EXISTS; #endif -using ::scanf; -using ::vscanf; +using ::scanf _LIBCPP_USING_IF_EXISTS; +using ::vscanf _LIBCPP_USING_IF_EXISTS; #endif #ifndef _LIBCPP_HAS_NO_STDOUT -using ::printf; -using ::putchar; -using ::puts; -using ::vprintf; +using ::printf _LIBCPP_USING_IF_EXISTS; +using ::putchar _LIBCPP_USING_IF_EXISTS; +using ::puts _LIBCPP_USING_IF_EXISTS; +using ::vprintf _LIBCPP_USING_IF_EXISTS; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/cstdlib b/libcxx/include/cstdlib index 82f8eed895b3a7..ced0321aa8e5c7 100644 --- a/libcxx/include/cstdlib +++ b/libcxx/include/cstdlib @@ -96,66 +96,66 @@ void *aligned_alloc(size_t alignment, size_t size); // C11 _LIBCPP_BEGIN_NAMESPACE_STD -using ::size_t; -using ::div_t; -using ::ldiv_t; +using ::size_t _LIBCPP_USING_IF_EXISTS; +using ::div_t _LIBCPP_USING_IF_EXISTS; +using ::ldiv_t _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_LONG_LONG -using ::lldiv_t; +using ::lldiv_t _LIBCPP_USING_IF_EXISTS; #endif // _LIBCPP_HAS_NO_LONG_LONG -using ::atof; -using ::atoi; -using ::atol; +using ::atof _LIBCPP_USING_IF_EXISTS; +using ::atoi _LIBCPP_USING_IF_EXISTS; +using ::atol _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_LONG_LONG -using ::atoll; +using ::atoll _LIBCPP_USING_IF_EXISTS; #endif // _LIBCPP_HAS_NO_LONG_LONG -using ::strtod; -using ::strtof; -using ::strtold; -using ::strtol; +using ::strtod _LIBCPP_USING_IF_EXISTS; +using ::strtof _LIBCPP_USING_IF_EXISTS; +using ::strtold _LIBCPP_USING_IF_EXISTS; +using ::strtol _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_LONG_LONG -using ::strtoll; +using ::strtoll _LIBCPP_USING_IF_EXISTS; #endif // _LIBCPP_HAS_NO_LONG_LONG -using ::strtoul; +using ::strtoul _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_LONG_LONG -using ::strtoull; +using ::strtoull _LIBCPP_USING_IF_EXISTS; #endif // _LIBCPP_HAS_NO_LONG_LONG -using ::rand; -using ::srand; -using ::calloc; -using ::free; -using ::malloc; -using ::realloc; -using ::abort; -using ::atexit; -using ::exit; -using ::_Exit; +using ::rand _LIBCPP_USING_IF_EXISTS; +using ::srand _LIBCPP_USING_IF_EXISTS; +using ::calloc _LIBCPP_USING_IF_EXISTS; +using ::free _LIBCPP_USING_IF_EXISTS; +using ::malloc _LIBCPP_USING_IF_EXISTS; +using ::realloc _LIBCPP_USING_IF_EXISTS; +using ::abort _LIBCPP_USING_IF_EXISTS; +using ::atexit _LIBCPP_USING_IF_EXISTS; +using ::exit _LIBCPP_USING_IF_EXISTS; +using ::_Exit _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_WINDOWS_STORE_APP -using ::getenv; -using ::system; +using ::getenv _LIBCPP_USING_IF_EXISTS; +using ::system _LIBCPP_USING_IF_EXISTS; #endif -using ::bsearch; -using ::qsort; -using ::abs; -using ::labs; +using ::bsearch _LIBCPP_USING_IF_EXISTS; +using ::qsort _LIBCPP_USING_IF_EXISTS; +using ::abs _LIBCPP_USING_IF_EXISTS; +using ::labs _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_LONG_LONG -using ::llabs; +using ::llabs _LIBCPP_USING_IF_EXISTS; #endif // _LIBCPP_HAS_NO_LONG_LONG -using ::div; -using ::ldiv; +using ::div _LIBCPP_USING_IF_EXISTS; +using ::ldiv _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_LONG_LONG -using ::lldiv; +using ::lldiv _LIBCPP_USING_IF_EXISTS; #endif // _LIBCPP_HAS_NO_LONG_LONG -using ::mblen; -using ::mbtowc; -using ::wctomb; -using ::mbstowcs; -using ::wcstombs; +using ::mblen _LIBCPP_USING_IF_EXISTS; +using ::mbtowc _LIBCPP_USING_IF_EXISTS; +using ::wctomb _LIBCPP_USING_IF_EXISTS; +using ::mbstowcs _LIBCPP_USING_IF_EXISTS; +using ::wcstombs _LIBCPP_USING_IF_EXISTS; #if !defined(_LIBCPP_CXX03_LANG) && defined(_LIBCPP_HAS_QUICK_EXIT) -using ::at_quick_exit; -using ::quick_exit; +using ::at_quick_exit _LIBCPP_USING_IF_EXISTS; +using ::quick_exit _LIBCPP_USING_IF_EXISTS; #endif #if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_ALIGNED_ALLOC) -using ::aligned_alloc; +using ::aligned_alloc _LIBCPP_USING_IF_EXISTS; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/cstring b/libcxx/include/cstring index 67814152478421..34449ab3330b5a 100644 --- a/libcxx/include/cstring +++ b/libcxx/include/cstring @@ -65,31 +65,31 @@ size_t strlen(const char* s); _LIBCPP_BEGIN_NAMESPACE_STD -using ::size_t; -using ::memcpy; -using ::memmove; -using ::strcpy; -using ::strncpy; -using ::strcat; -using ::strncat; -using ::memcmp; -using ::strcmp; -using ::strncmp; -using ::strcoll; -using ::strxfrm; -using ::memchr; -using ::strchr; -using ::strcspn; -using ::strpbrk; -using ::strrchr; -using ::strspn; -using ::strstr; +using ::size_t _LIBCPP_USING_IF_EXISTS; +using ::memcpy _LIBCPP_USING_IF_EXISTS; +using ::memmove _LIBCPP_USING_IF_EXISTS; +using ::strcpy _LIBCPP_USING_IF_EXISTS; +using ::strncpy _LIBCPP_USING_IF_EXISTS; +using ::strcat _LIBCPP_USING_IF_EXISTS; +using ::strncat _LIBCPP_USING_IF_EXISTS; +using ::memcmp _LIBCPP_USING_IF_EXISTS; +using ::strcmp _LIBCPP_USING_IF_EXISTS; +using ::strncmp _LIBCPP_USING_IF_EXISTS; +using ::strcoll _LIBCPP_USING_IF_EXISTS; +using ::strxfrm _LIBCPP_USING_IF_EXISTS; +using ::memchr _LIBCPP_USING_IF_EXISTS; +using ::strchr _LIBCPP_USING_IF_EXISTS; +using ::strcspn _LIBCPP_USING_IF_EXISTS; +using ::strpbrk _LIBCPP_USING_IF_EXISTS; +using ::strrchr _LIBCPP_USING_IF_EXISTS; +using ::strspn _LIBCPP_USING_IF_EXISTS; +using ::strstr _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS -using ::strtok; +using ::strtok _LIBCPP_USING_IF_EXISTS; #endif -using ::memset; -using ::strerror; -using ::strlen; +using ::memset _LIBCPP_USING_IF_EXISTS; +using ::strerror _LIBCPP_USING_IF_EXISTS; +using ::strlen _LIBCPP_USING_IF_EXISTS; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/ctime b/libcxx/include/ctime index cf9cc7e211dd61..8b2efd7449ca9d 100644 --- a/libcxx/include/ctime +++ b/libcxx/include/ctime @@ -68,26 +68,26 @@ int timespec_get( struct timespec *ts, int base); // C++17 _LIBCPP_BEGIN_NAMESPACE_STD -using ::clock_t; -using ::size_t; -using ::time_t; -using ::tm; +using ::clock_t _LIBCPP_USING_IF_EXISTS; +using ::size_t _LIBCPP_USING_IF_EXISTS; +using ::time_t _LIBCPP_USING_IF_EXISTS; +using ::tm _LIBCPP_USING_IF_EXISTS; #if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET) -using ::timespec; +using ::timespec _LIBCPP_USING_IF_EXISTS; #endif -using ::clock; -using ::difftime; -using ::mktime; -using ::time; +using ::clock _LIBCPP_USING_IF_EXISTS; +using ::difftime _LIBCPP_USING_IF_EXISTS; +using ::mktime _LIBCPP_USING_IF_EXISTS; +using ::time _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS -using ::asctime; -using ::ctime; -using ::gmtime; -using ::localtime; +using ::asctime _LIBCPP_USING_IF_EXISTS; +using ::ctime _LIBCPP_USING_IF_EXISTS; +using ::gmtime _LIBCPP_USING_IF_EXISTS; +using ::localtime _LIBCPP_USING_IF_EXISTS; #endif -using ::strftime; +using ::strftime _LIBCPP_USING_IF_EXISTS; #if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET) && !defined(_LIBCPP_HAS_TIMESPEC_GET_NOT_ACTUALLY_PROVIDED) -using ::timespec_get; +using ::timespec_get _LIBCPP_USING_IF_EXISTS; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/cwchar b/libcxx/include/cwchar index 5803496d088925..f39046f0a9c2ca 100644 --- a/libcxx/include/cwchar +++ b/libcxx/include/cwchar @@ -112,79 +112,79 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len, _LIBCPP_BEGIN_NAMESPACE_STD -using ::mbstate_t; -using ::size_t; -using ::tm; -using ::wint_t; -using ::FILE; -using ::fwprintf; -using ::fwscanf; -using ::swprintf; -using ::vfwprintf; -using ::vswprintf; -using ::swscanf; -using ::vfwscanf; -using ::vswscanf; -using ::fgetwc; -using ::fgetws; -using ::fputwc; -using ::fputws; -using ::fwide; -using ::getwc; -using ::putwc; -using ::ungetwc; -using ::wcstod; -using ::wcstof; -using ::wcstold; -using ::wcstol; +using ::mbstate_t _LIBCPP_USING_IF_EXISTS; +using ::size_t _LIBCPP_USING_IF_EXISTS; +using ::tm _LIBCPP_USING_IF_EXISTS; +using ::wint_t _LIBCPP_USING_IF_EXISTS; +using ::FILE _LIBCPP_USING_IF_EXISTS; +using ::fwprintf _LIBCPP_USING_IF_EXISTS; +using ::fwscanf _LIBCPP_USING_IF_EXISTS; +using ::swprintf _LIBCPP_USING_IF_EXISTS; +using ::vfwprintf _LIBCPP_USING_IF_EXISTS; +using ::vswprintf _LIBCPP_USING_IF_EXISTS; +using ::swscanf _LIBCPP_USING_IF_EXISTS; +using ::vfwscanf _LIBCPP_USING_IF_EXISTS; +using ::vswscanf _LIBCPP_USING_IF_EXISTS; +using ::fgetwc _LIBCPP_USING_IF_EXISTS; +using ::fgetws _LIBCPP_USING_IF_EXISTS; +using ::fputwc _LIBCPP_USING_IF_EXISTS; +using ::fputws _LIBCPP_USING_IF_EXISTS; +using ::fwide _LIBCPP_USING_IF_EXISTS; +using ::getwc _LIBCPP_USING_IF_EXISTS; +using ::putwc _LIBCPP_USING_IF_EXISTS; +using ::ungetwc _LIBCPP_USING_IF_EXISTS; +using ::wcstod _LIBCPP_USING_IF_EXISTS; +using ::wcstof _LIBCPP_USING_IF_EXISTS; +using ::wcstold _LIBCPP_USING_IF_EXISTS; +using ::wcstol _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_LONG_LONG -using ::wcstoll; +using ::wcstoll _LIBCPP_USING_IF_EXISTS; #endif // _LIBCPP_HAS_NO_LONG_LONG -using ::wcstoul; +using ::wcstoul _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_LONG_LONG -using ::wcstoull; +using ::wcstoull _LIBCPP_USING_IF_EXISTS; #endif // _LIBCPP_HAS_NO_LONG_LONG -using ::wcscpy; -using ::wcsncpy; -using ::wcscat; -using ::wcsncat; -using ::wcscmp; -using ::wcscoll; -using ::wcsncmp; -using ::wcsxfrm; -using ::wcschr; -using ::wcspbrk; -using ::wcsrchr; -using ::wcsstr; -using ::wmemchr; -using ::wcscspn; -using ::wcslen; -using ::wcsspn; -using ::wcstok; -using ::wmemcmp; -using ::wmemcpy; -using ::wmemmove; -using ::wmemset; -using ::wcsftime; -using ::btowc; -using ::wctob; -using ::mbsinit; -using ::mbrlen; -using ::mbrtowc; -using ::wcrtomb; -using ::mbsrtowcs; -using ::wcsrtombs; +using ::wcscpy _LIBCPP_USING_IF_EXISTS; +using ::wcsncpy _LIBCPP_USING_IF_EXISTS; +using ::wcscat _LIBCPP_USING_IF_EXISTS; +using ::wcsncat _LIBCPP_USING_IF_EXISTS; +using ::wcscmp _LIBCPP_USING_IF_EXISTS; +using ::wcscoll _LIBCPP_USING_IF_EXISTS; +using ::wcsncmp _LIBCPP_USING_IF_EXISTS; +using ::wcsxfrm _LIBCPP_USING_IF_EXISTS; +using ::wcschr _LIBCPP_USING_IF_EXISTS; +using ::wcspbrk _LIBCPP_USING_IF_EXISTS; +using ::wcsrchr _LIBCPP_USING_IF_EXISTS; +using ::wcsstr _LIBCPP_USING_IF_EXISTS; +using ::wmemchr _LIBCPP_USING_IF_EXISTS; +using ::wcscspn _LIBCPP_USING_IF_EXISTS; +using ::wcslen _LIBCPP_USING_IF_EXISTS; +using ::wcsspn _LIBCPP_USING_IF_EXISTS; +using ::wcstok _LIBCPP_USING_IF_EXISTS; +using ::wmemcmp _LIBCPP_USING_IF_EXISTS; +using ::wmemcpy _LIBCPP_USING_IF_EXISTS; +using ::wmemmove _LIBCPP_USING_IF_EXISTS; +using ::wmemset _LIBCPP_USING_IF_EXISTS; +using ::wcsftime _LIBCPP_USING_IF_EXISTS; +using ::btowc _LIBCPP_USING_IF_EXISTS; +using ::wctob _LIBCPP_USING_IF_EXISTS; +using ::mbsinit _LIBCPP_USING_IF_EXISTS; +using ::mbrlen _LIBCPP_USING_IF_EXISTS; +using ::mbrtowc _LIBCPP_USING_IF_EXISTS; +using ::wcrtomb _LIBCPP_USING_IF_EXISTS; +using ::mbsrtowcs _LIBCPP_USING_IF_EXISTS; +using ::wcsrtombs _LIBCPP_USING_IF_EXISTS; #ifndef _LIBCPP_HAS_NO_STDIN -using ::getwchar; -using ::vwscanf; -using ::wscanf; +using ::getwchar _LIBCPP_USING_IF_EXISTS; +using ::vwscanf _LIBCPP_USING_IF_EXISTS; +using ::wscanf _LIBCPP_USING_IF_EXISTS; #endif #ifndef _LIBCPP_HAS_NO_STDOUT -using ::putwchar; -using ::vwprintf; -using ::wprintf; +using ::putwchar _LIBCPP_USING_IF_EXISTS; +using ::vwprintf _LIBCPP_USING_IF_EXISTS; +using ::wprintf _LIBCPP_USING_IF_EXISTS; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/cwctype b/libcxx/include/cwctype index 8b9c2c6346eb07..17c68d6d4544fc 100644 --- a/libcxx/include/cwctype +++ b/libcxx/include/cwctype @@ -59,27 +59,27 @@ wctrans_t wctrans(const char* property); _LIBCPP_BEGIN_NAMESPACE_STD -using ::wint_t; -using ::wctrans_t; -using ::wctype_t; -using ::iswalnum; -using ::iswalpha; -using ::iswblank; -using ::iswcntrl; -using ::iswdigit; -using ::iswgraph; -using ::iswlower; -using ::iswprint; -using ::iswpunct; -using ::iswspace; -using ::iswupper; -using ::iswxdigit; -using ::iswctype; -using ::wctype; -using ::towlower; -using ::towupper; -using ::towctrans; -using ::wctrans; +using ::wint_t _LIBCPP_USING_IF_EXISTS; +using ::wctrans_t _LIBCPP_USING_IF_EXISTS; +using ::wctype_t _LIBCPP_USING_IF_EXISTS; +using ::iswalnum _LIBCPP_USING_IF_EXISTS; +using ::iswalpha _LIBCPP_USING_IF_EXISTS; +using ::iswblank _LIBCPP_USING_IF_EXISTS; +using ::iswcntrl _LIBCPP_USING_IF_EXISTS; +using ::iswdigit _LIBCPP_USING_IF_EXISTS; +using ::iswgraph _LIBCPP_USING_IF_EXISTS; +using ::iswlower _LIBCPP_USING_IF_EXISTS; +using ::iswprint _LIBCPP_USING_IF_EXISTS; +using ::iswpunct _LIBCPP_USING_IF_EXISTS; +using ::iswspace _LIBCPP_USING_IF_EXISTS; +using ::iswupper _LIBCPP_USING_IF_EXISTS; +using ::iswxdigit _LIBCPP_USING_IF_EXISTS; +using ::iswctype _LIBCPP_USING_IF_EXISTS; +using ::wctype _LIBCPP_USING_IF_EXISTS; +using ::towlower _LIBCPP_USING_IF_EXISTS; +using ::towupper _LIBCPP_USING_IF_EXISTS; +using ::towctrans _LIBCPP_USING_IF_EXISTS; +using ::wctrans _LIBCPP_USING_IF_EXISTS; _LIBCPP_END_NAMESPACE_STD