@@ -524,19 +524,47 @@ struct __te_impl {
524524# endif
525525 }
526526
527- # if _LIBCPP_HAS_LOCALIZATION && !defined(__ANDROID__)
528- _LIBCPP_HIDDEN static __te_impl __get_locale_encoding (const char * __name);
529- # if defined(_LIBCPP_WIN32API)
527+ # if _LIBCPP_HAS_LOCALIZATION
528+ // TODO: Android has <langinfo.h> but not nl_langinfo_l which is required to implement this function.
529+ # if !defined(__ANDROID__)
530+ # if defined(_LIBCPP_WIN32API)
530531 _LIBCPP_HIDDEN static __id __get_win32_acp ();
531- # endif
532+ # endif
533+ _LIBCPP_HIDDEN static __te_impl __get_locale_encoding (const char * __name);
532534 _LIBCPP_HIDDEN static __te_impl __get_env_encoding ();
535+
533536 [[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI static __te_impl __environment ();
534537
535538 template <__id _Id>
536539 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static bool __environment_is () {
537540 return __environment () == _Id;
538541 }
542+
543+ # else
544+ _LIBCPP_HIDDEN static __te_impl __get_locale_encoding (const char * __name) = delete;
545+ _LIBCPP_HIDDEN static __te_impl __get_env_encoding () = delete;
546+
547+ [[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI static __te_impl __environment ();
548+
549+ template <__id _Id>
550+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static bool __environment_is () {
551+ return false ;
552+ }
553+ # endif
554+
555+ # else
556+
557+ # if defined(_LIBCPP_WIN32API)
558+ _LIBCPP_HIDDEN static __id __get_win32_acp () = delete;
559+ # endif
560+ _LIBCPP_HIDDEN static __te_impl __get_locale_encoding (const char * __name) = delete;
561+ _LIBCPP_HIDDEN static __te_impl __get_env_encoding () = delete;
562+ [[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI static __te_impl __environment () = delete;
563+ template <__id _Id>
564+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static bool __environment_is () = delete;
565+
539566# endif
567+
540568 const __te_data* __encoding_rep_ = __text_encoding_data + 1 ;
541569 char __name_[__max_name_length_ + 1 ] = {0 };
542570
0 commit comments