Skip to content

Commit

Permalink
To ensure correct usage of codecvt
Browse files Browse the repository at this point in the history
  • Loading branch information
sc2ad committed Oct 16, 2023
1 parent 1f027e6 commit 08dc05f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/typedefs-wrapper.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include <string.h>
#include <locale>
#include <type_traits>
#include "../../shared/utils/il2cpp-functions.hpp"
#include "../../shared/utils/typedefs-string.hpp"
#include "../../shared/utils/typedefs-wrappers.hpp"
#include "../../shared/utils/typedefs.h"


std::unordered_map<void*, size_t> Counter::addrRefCount;
std::shared_mutex Counter::mutex;

Expand All @@ -21,6 +21,10 @@ struct deletable_facet : Facet {
// Note that char is actually required here over char8_t-- this is due to NDK not having a char8_t specialization for this yet.
deletable_facet<std::codecvt<char16_t, char8_t, std::mbstate_t>> conv;

template <class T>
concept is_specialized = std::is_same_v<char16_t, typename T::intern_type>;
static_assert(is_specialized<std::codecvt<char16_t, char8_t, std::mbstate_t>>);

void convstr(char const* inp, char16_t* outp, int sz) {
std::mbstate_t state;
char8_t const* from_next;
Expand Down

0 comments on commit 08dc05f

Please sign in to comment.