xref: /llvm-project/libcxx/include/__support/xlocale/__nop_locale_mgmt.h (revision 34e0f9cd36e9d4eb7fd153f536c811ec668be458)
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 //===----------------------------------------------------------------------===//
9 
10 #ifndef _LIBCPP___SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
11 #define _LIBCPP___SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
12 
13 #include <__config>
14 
15 // Patch over lack of extended locale support
16 typedef void* locale_t;
17 
18 inline _LIBCPP_HIDE_FROM_ABI locale_t duplocale(locale_t) { return nullptr; }
19 
20 inline _LIBCPP_HIDE_FROM_ABI void freelocale(locale_t) {}
21 
22 inline _LIBCPP_HIDE_FROM_ABI locale_t newlocale(int, const char*, locale_t) { return nullptr; }
23 
24 #define LC_COLLATE_MASK (1 << LC_COLLATE)
25 #define LC_CTYPE_MASK (1 << LC_CTYPE)
26 #define LC_MESSAGES_MASK (1 << LC_MESSAGES)
27 #define LC_MONETARY_MASK (1 << LC_MONETARY)
28 #define LC_NUMERIC_MASK (1 << LC_NUMERIC)
29 #define LC_TIME_MASK (1 << LC_TIME)
30 #define LC_ALL_MASK                                                                                                    \
31   (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK | LC_MESSAGES_MASK)
32 
33 #endif // _LIBCPP___SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
34