Skip to content

Commit

Permalink
🛠 Use appropriate C++ detection idioms
Browse files Browse the repository at this point in the history
— 🩹 Closes #23
  • Loading branch information
ThePhD committed Apr 20, 2022
1 parent 938f9b3 commit 299288f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions include/ztd/text/impl/execution_cuchar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

#include <ztd/ranges/range.hpp>
#include <ztd/idk/span.hpp>
#include <ztd/idk/encoding_detection.h>
#include <ztd/idk/encoding_detection.hpp>
#include <ztd/idk/detail/windows.hpp>

#if (ZTD_IS_ON(ZTD_CUCHAR_I_) || ZTD_IS_ON(ZTD_UCHAR_I_)) && ZTD_IS_OFF(ZTD_PLATFORM_MAC_OS_I_)
Expand Down Expand Up @@ -201,7 +201,7 @@ namespace ztd { namespace text {
/// `std::setlocale` name checking otherwise).
//////
static bool contains_unicode_encoding() noexcept {
return ztdc_is_execution_encoding_unicode();
return ztd::is_execution_encoding_unicode();
}

//////
Expand Down Expand Up @@ -238,7 +238,7 @@ namespace ztd { namespace text {
= __txt_detail::__reconstruct_encode_result_t<_InputRange, _OutputRange, encode_state>;
constexpr bool __call_error_handler = !is_ignorable_error_handler_v<_UErrorHandler>;

if (ztdc_is_execution_encoding_utf8()) {
if (ztd::is_execution_encoding_utf8()) {
// just go straight to UTF8
using __execution_utf8 = __txt_impl::__utf8_with<__execution_cuchar, code_unit, code_point,
decode_state, encode_state>;
Expand Down Expand Up @@ -442,7 +442,7 @@ namespace ztd { namespace text {
= __txt_detail::__reconstruct_decode_result_t<_InputRange, _OutputRange, decode_state>;
constexpr bool __call_error_handler = !is_ignorable_error_handler_v<_UErrorHandler>;

if (ztdc_is_execution_encoding_utf8()) {
if (ztd::is_execution_encoding_utf8()) {
// just go straight to UTF8
using __execution_utf8 = __txt_impl::__utf8_with<__execution_cuchar, code_unit, code_point,
decode_state, encode_state>;
Expand Down
6 changes: 3 additions & 3 deletions include/ztd/text/impl/wide_execution_cwchar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

#include <ztd/ranges/range.hpp>
#include <ztd/idk/span.hpp>
#include <ztd/idk/encoding_detection.h>
#include <ztd/idk/encoding_detection.hpp>

#include <ztd/prologue.hpp>

Expand Down Expand Up @@ -191,10 +191,10 @@ namespace ztd { namespace text {
static bool contains_unicode_encoding() noexcept {
// even if the wide encoding is unicode, we have to round-trip through the execution encoding, so if
// this doesn't work then nothing works with all unicode code points!
if (!ztdc_is_execution_encoding_unicode()) {
if (!ztd::is_execution_encoding_unicode()) {
return false;
}
return ztdc_is_wide_execution_encoding_unicode();
return ztd::is_wide_execution_encoding_unicode();
}

//////
Expand Down

0 comments on commit 299288f

Please sign in to comment.