[libcxx-commits] [libcxx] [AIX][libc++] Forward-declare locale functions in aix.h when _XOPEN_SOURCE < 700 (PR #220508)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 3 05:09:31 PDT 2026


================
@@ -25,6 +25,16 @@
 #  include <wctype.h>
 #endif
 
+// Forward declare for _XOPEN_SOURCE=500 and _XOPEN_SOURCE=600
+#if defined(_XOPEN_SOURCE) && _XOPEN_SOURCE < 700
+extern "C" {
+locale_t newlocale(int, const char*, locale_t) noexcept;
----------------
philnik777 wrote:

Could you open a separate patch to refactor these, so that we have something like `__str_to_float_c_locale<FloatT>` in the locale API? That would make it more clear what we _actually_ need from the API, and should make removing `__setAndRestore` a more obvious refactor. By removing `__setAndRestore` we should be able to remove `newlocale` and `freelocale` from the list as well I believe.

https://github.com/llvm/llvm-project/pull/220508


More information about the libcxx-commits mailing list