xref: /openbsd-src/gnu/llvm/libcxx/include/__support/xlocale/__nop_locale_mgmt.h (revision 4bdff4bed0e3d54e55670334c7d0077db4170f86)
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 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 // Patch over lack of extended locale support
20 typedef void *locale_t;
21 
duplocale(locale_t)22 inline _LIBCPP_HIDE_FROM_ABI_C locale_t duplocale(locale_t) { return NULL; }
23 
freelocale(locale_t)24 inline _LIBCPP_HIDE_FROM_ABI_C void freelocale(locale_t) {}
25 
newlocale(int,const char *,locale_t)26 inline _LIBCPP_HIDE_FROM_ABI_C locale_t newlocale(int, const char*, locale_t) { return NULL; }
27 
uselocale(locale_t)28 inline _LIBCPP_HIDE_FROM_ABI_C locale_t uselocale(locale_t) { return NULL; }
29 
30 #define LC_COLLATE_MASK  (1 << LC_COLLATE)
31 #define LC_CTYPE_MASK    (1 << LC_CTYPE)
32 #define LC_MESSAGES_MASK (1 << LC_MESSAGES)
33 #define LC_MONETARY_MASK (1 << LC_MONETARY)
34 #define LC_NUMERIC_MASK  (1 << LC_NUMERIC)
35 #define LC_TIME_MASK     (1 << LC_TIME)
36 #define LC_ALL_MASK (LC_COLLATE_MASK|\
37                      LC_CTYPE_MASK|\
38                      LC_MONETARY_MASK|\
39                      LC_NUMERIC_MASK|\
40                      LC_TIME_MASK|\
41                      LC_MESSAGES_MASK)
42 
43 #ifdef __cplusplus
44 } // extern "C"
45 #endif
46 
47 #endif // _LIBCPP___SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
48