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

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 4 01:20:52 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;
----------------
Himadhith wrote:

Working on this patch, I will keep the calls to the API from `num.h` to be same `__strtof`, `__strtod` and `__strtold` and change it in `aix.h`. But doesn't this mean the refactor will touch upon other platforms as well which invoke the said functions from `num.h`? 

`__setAndRestore` will be needed for `__APPLE__`,  `__FreeBSD__` and possibly `__NetBSD__` as these don't have `__cloc()` defined. 

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


More information about the libcxx-commits mailing list