#include #include #if defined(__wasilibc_unmodified_upstream) || defined(_REENTRANT) #include #endif #include "locale_impl.h" #include "lock.h" #define malloc __libc_malloc #define calloc undef #define realloc undef #define free undef static int default_locale_init_done; static struct __locale_struct default_locale, default_ctype_locale; int __loc_is_allocated(locale_t loc) { return loc && loc != C_LOCALE && loc != UTF8_LOCALE && loc != &default_locale && loc != &default_ctype_locale; } static locale_t do_newlocale(int mask, const char *name, locale_t loc) { struct __locale_struct tmp; for (int i=0; icat[i] : __get_locale(i, (mask & (1<