[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / libcxx / include / __support / ibm / locale_mgmt_zos.h
blob179f563eb7557fab87c1a8d5d93d64aa55f896a7
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
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
7 //
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___SUPPORT_IBM_LOCALE_MGMT_ZOS_H
11 #define _LIBCPP___SUPPORT_IBM_LOCALE_MGMT_ZOS_H
13 #if defined(__MVS__)
14 #include <locale.h>
15 #include <string>
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
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 {
34 int category_mask;
35 std::string lc_collate;
36 std::string lc_ctype;
37 std::string lc_monetary;
38 std::string lc_numeric;
39 std::string lc_time;
40 std::string lc_messages;
41 } * locale_t;
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);
49 #ifdef __cplusplus
51 #endif
52 #endif // defined(__MVS__)
53 #endif // _LIBCPP___SUPPORT_IBM_LOCALE_MGMT_ZOS_H