blob: d067cf85a3bcb6f12efe819b99239157c731a9d1 [file] [log] [blame]
Jonathan Roelofs6a5a8ab2014-09-19 20:09:12 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
11#define _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
12
13#if defined(_NEWLIB_VERSION)
14
15#include <cstdlib>
16#include <clocale>
17#include <cwctype>
18#include <ctype.h>
Dan Albert1d4a1ed2016-05-25 22:36:09 -070019
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24// Patch over newlib's lack of extended locale support
25typedef void *locale_t;
26static inline locale_t duplocale(locale_t) {
27 return NULL;
28}
29
30static inline void freelocale(locale_t) {
31}
32
33static inline locale_t newlocale(int, const char *, locale_t) {
34 return NULL;
35}
36
37static inline locale_t uselocale(locale_t) {
38 return NULL;
39}
40
41#define LC_COLLATE_MASK (1 << LC_COLLATE)
42#define LC_CTYPE_MASK (1 << LC_CTYPE)
43#define LC_MESSAGES_MASK (1 << LC_MESSAGES)
44#define LC_MONETARY_MASK (1 << LC_MONETARY)
45#define LC_NUMERIC_MASK (1 << LC_NUMERIC)
46#define LC_TIME_MASK (1 << LC_TIME)
47#define LC_ALL_MASK (LC_COLLATE_MASK|\
48 LC_CTYPE_MASK|\
49 LC_MONETARY_MASK|\
50 LC_NUMERIC_MASK|\
51 LC_TIME_MASK|\
52 LC_MESSAGES_MASK)
53
54// Share implementation with Android's Bionic
55#include <support/xlocale/xlocale.h>
56
57#ifdef __cplusplus
58} // extern "C"
59#endif
Jonathan Roelofs6a5a8ab2014-09-19 20:09:12 +000060
61#endif // _NEWLIB_VERSION
62
63#endif