Skip to content

Commit

Permalink
[libc++][NFC] Remove #endif comments for really small conditionals on…
Browse files Browse the repository at this point in the history
… _LIBCPP_HAS_NO_UNICODE_CHARS

We generally don't put a comment on the #endif when the #if block is so small
that it's unambiguous what the #endif refers to.
  • Loading branch information
ldionne committed Sep 9, 2021
1 parent cf765b1 commit 71752e0
Show file tree
Hide file tree
Showing 40 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion libcxx/include/__config
Expand Up @@ -789,7 +789,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
typedef unsigned short char16_t;
typedef unsigned int char32_t;
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif

#ifndef __SIZEOF_INT128__
#define _LIBCPP_HAS_NO_INT128
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/cstddef
Expand Up @@ -65,7 +65,7 @@ template <> struct __libcpp_is_integral<char8_t> { enum { va
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
template <> struct __libcpp_is_integral<char16_t> { enum { value = 1 }; };
template <> struct __libcpp_is_integral<char32_t> { enum { value = 1 }; };
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
template <> struct __libcpp_is_integral<short> { enum { value = 1 }; };
template <> struct __libcpp_is_integral<unsigned short> { enum { value = 1 }; };
template <> struct __libcpp_is_integral<int> { enum { value = 1 }; };
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/iosfwd
Expand Up @@ -227,7 +227,7 @@ typedef fpos<mbstate_t> u8streampos;
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
typedef fpos<mbstate_t> u16streampos;
typedef fpos<mbstate_t> u32streampos;
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif

#if defined(_NEWLIB_VERSION)
// On newlib, off_t is 'long int'
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/string
Expand Up @@ -675,7 +675,7 @@ typedef basic_string<char8_t> u8string;
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
typedef basic_string<char16_t> u16string;
typedef basic_string<char32_t> u32string;
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif

template<class _CharT, class _Traits, class _Allocator>
class
Expand Down
Expand Up @@ -182,7 +182,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<std::atomic_char16_t, char16_t>();
test<std::atomic_char32_t, char32_t>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<std::atomic_wchar_t, wchar_t>();

test<std::atomic_int8_t, int8_t>();
Expand All @@ -208,7 +208,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<volatile std::atomic_char16_t, char16_t>();
test<volatile std::atomic_char32_t, char32_t>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<volatile std::atomic_wchar_t, wchar_t>();

test<volatile std::atomic_int8_t, int8_t>();
Expand Down
Expand Up @@ -63,7 +63,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
static_assert((std::is_same<std::atomic<char16_t>, std::atomic_char16_t>::value), "");
static_assert((std::is_same<std::atomic<char32_t>, std::atomic_char32_t>::value), "");
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif

// Added by LWG 2441
static_assert((std::is_same<std::atomic<intptr_t>, std::atomic_intptr_t>::value), "");
Expand Down
Expand Up @@ -52,7 +52,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t>();
test<char32_t>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<signed char>();
test<unsigned char>();
test<signed short>();
Expand Down
Expand Up @@ -39,7 +39,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t>(0);
test<char32_t>(0);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short>(0);
test<unsigned short>(0);
test<int>(0);
Expand Down
Expand Up @@ -38,7 +38,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, 16>();
test<char32_t, 32>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, 15>();
test<unsigned short, 16>();
test<int, 31>();
Expand Down
Expand Up @@ -42,7 +42,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, 4>();
test<char32_t, 9>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, 4>();
test<unsigned short, 4>();
test<int, 9>();
Expand Down
Expand Up @@ -39,7 +39,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t>(0);
test<char32_t>(0);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short>(0);
test<unsigned short>(0);
test<int>(0);
Expand Down
Expand Up @@ -37,7 +37,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, std::denorm_absent>();
test<char32_t, std::denorm_absent>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, std::denorm_absent>();
test<unsigned short, std::denorm_absent>();
test<int, std::denorm_absent>();
Expand Down
Expand Up @@ -37,7 +37,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, false>();
test<char32_t, false>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, false>();
test<unsigned short, false>();
test<int, false>();
Expand Down
Expand Up @@ -37,7 +37,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, false>();
test<char32_t, false>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, false>();
test<unsigned short, false>();
test<int, false>();
Expand Down
Expand Up @@ -37,7 +37,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, false>();
test<char32_t, false>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, false>();
test<unsigned short, false>();
test<int, false>();
Expand Down
Expand Up @@ -37,7 +37,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, false>();
test<char32_t, false>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, false>();
test<unsigned short, false>();
test<int, false>();
Expand Down
Expand Up @@ -41,7 +41,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t>(0);
test<char32_t>(0);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short>(0);
test<unsigned short>(0);
test<int>(0);
Expand Down
Expand Up @@ -37,7 +37,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, true>();
test<char32_t, true>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, true>();
test<unsigned short, true>();
test<int, true>();
Expand Down
Expand Up @@ -37,7 +37,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, true>();
test<char32_t, true>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, true>();
test<unsigned short, true>();
test<int, true>();
Expand Down
Expand Up @@ -37,7 +37,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, false>();
test<char32_t, false>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, false>();
test<unsigned short, false>();
test<int, false>();
Expand Down
Expand Up @@ -37,7 +37,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, true>();
test<char32_t, true>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, true>();
test<unsigned short, true>();
test<int, true>();
Expand Down
Expand Up @@ -37,7 +37,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, true>();
test<char32_t, true>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, false>();
test<unsigned short, true>();
test<int, false>();
Expand Down
Expand Up @@ -37,7 +37,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, false>();
test<char32_t, false>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, true>();
test<unsigned short, false>();
test<int, true>();
Expand Down
Expand Up @@ -45,7 +45,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t>(0);
test<char32_t>(0);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short>(SHRT_MIN);
test<unsigned short>(0);
test<int>(INT_MIN);
Expand Down
Expand Up @@ -45,7 +45,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t>(USHRT_MAX);
test<char32_t>(UINT_MAX);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short>(SHRT_MAX);
test<unsigned short>(USHRT_MAX);
test<int>(INT_MAX);
Expand Down
Expand Up @@ -38,7 +38,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, 0>();
test<char32_t, 0>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, 0>();
test<unsigned short, 0>();
test<int, 0>();
Expand Down
Expand Up @@ -38,7 +38,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, 0>();
test<char32_t, 0>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, 0>();
test<unsigned short, 0>();
test<int, 0>();
Expand Down
Expand Up @@ -38,7 +38,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, 0>();
test<char32_t, 0>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, 0>();
test<unsigned short, 0>();
test<int, 0>();
Expand Down
Expand Up @@ -45,7 +45,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t>(0);
test<char32_t>(0);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short>(SHRT_MIN);
test<unsigned short>(0);
test<int>(INT_MIN);
Expand Down
Expand Up @@ -38,7 +38,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, 0>();
test<char32_t, 0>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, 0>();
test<unsigned short, 0>();
test<int, 0>();
Expand Down
Expand Up @@ -38,7 +38,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, 0>();
test<char32_t, 0>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, 0>();
test<unsigned short, 0>();
test<int, 0>();
Expand Down
Expand Up @@ -58,7 +58,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t>();
test<char32_t>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short>();
test<unsigned short>();
test<int>();
Expand Down
Expand Up @@ -38,7 +38,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, 2>();
test<char32_t, 2>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, 2>();
test<unsigned short, 2>();
test<int, 2>();
Expand Down
Expand Up @@ -39,7 +39,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t>(0);
test<char32_t>(0);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short>(0);
test<unsigned short>(0);
test<int>(0);
Expand Down
Expand Up @@ -37,7 +37,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, std::round_toward_zero>();
test<char32_t, std::round_toward_zero>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, std::round_toward_zero>();
test<unsigned short, std::round_toward_zero>();
test<int, std::round_toward_zero>();
Expand Down
Expand Up @@ -37,7 +37,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, false>();
test<char32_t, false>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, false>();
test<unsigned short, false>();
test<int, false>();
Expand Down
Expand Up @@ -44,7 +44,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<char16_t, integral_types_trap>();
test<char32_t, integral_types_trap>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<short, integral_types_trap>();
test<unsigned short, integral_types_trap>();
test<int, integral_types_trap>();
Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/std/strings/basic.string.hash/strings.pass.cpp
Expand Up @@ -49,7 +49,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<std::u16string>();
test<std::u32string>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<std::wstring>();

return 0;
Expand Down
Expand Up @@ -64,7 +64,7 @@ int main(int, char**)
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test<std::u16string_view>();
test<std::u32string_view>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif
test<std::wstring_view>();

return 0;
Expand Down
Expand Up @@ -143,7 +143,7 @@ int main() {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
test_uchars<char16_t>();
test_uchars<char32_t>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#endif

return 0;
}

0 comments on commit 71752e0

Please sign in to comment.