[libcxx-commits] [libcxx] [libc++][z/OS] Move z/OS to new locale API and resolve all name collisions (PR #165428)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 28 16:42:33 PDT 2025


================
@@ -0,0 +1,318 @@
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___LOCALE_DIR_SUPPORT_IBM_H
+#define _LIBCPP___LOCALE_DIR_SUPPORT_IBM_H
+
+#include <__support/ibm/locale_mgmt_zos.h>
+#include <__support/ibm/vasprintf.h>
+
+#include "cstdlib"
+#include <clocale> // std::lconv
+#include <locale.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+#include <wctype.h>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// These functions are exported within std namespace
+// for compatibility with previous versions.
+_LIBCPP_EXPORTED_FROM_ABI int isdigit_l(int, locale_t);
+_LIBCPP_EXPORTED_FROM_ABI int isxdigit_l(int, locale_t);
+
+namespace __locale {
+struct __locale_guard {
+  _LIBCPP_HIDE_FROM_ABI __locale_guard(locale_t& __loc) : __old_loc_(std::uselocale(__loc)) {}
+
+  _LIBCPP_HIDE_FROM_ABI ~__locale_guard() {
+    // if (__old_loc_)
----------------
ldionne wrote:

```suggestion
```

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


More information about the libcxx-commits mailing list