2 //===----------------------------------------------------------------------===//
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___SUPPORT_IBM_LOCALE_MGMT_ZOS_H
11 #define _LIBCPP___SUPPORT_IBM_LOCALE_MGMT_ZOS_H
21 # define _LC_MAX LC_MESSAGES /* highest real category */
22 # define _NCAT (_LC_MAX + 1) /* maximum + 1 */
24 # define _CATMASK(n) (1 << (n))
25 # define LC_COLLATE_MASK _CATMASK(LC_COLLATE)
26 # define LC_CTYPE_MASK _CATMASK(LC_CTYPE)
27 # define LC_MONETARY_MASK _CATMASK(LC_MONETARY)
28 # define LC_NUMERIC_MASK _CATMASK(LC_NUMERIC)
29 # define LC_TIME_MASK _CATMASK(LC_TIME)
30 # define LC_MESSAGES_MASK _CATMASK(LC_MESSAGES)
31 # define LC_ALL_MASK (_CATMASK(_NCAT) - 1)
33 typedef struct locale_struct
{
35 std::string lc_collate
;
37 std::string lc_monetary
;
38 std::string lc_numeric
;
40 std::string lc_messages
;
43 // z/OS does not have newlocale, freelocale and uselocale.
44 // The functions below are workarounds in single thread mode.
45 locale_t
newlocale(int category_mask
, const char* locale
, locale_t base
);
46 void freelocale(locale_t locobj
);
47 locale_t
uselocale(locale_t newloc
);
52 #endif // defined(__MVS__)
53 #endif // _LIBCPP___SUPPORT_IBM_LOCALE_MGMT_ZOS_H