1//===----------------------------------------------------------------------===//
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////////////////////////////////////////////////////////////////////////////////
11// Minimal xlocale implementation for Solaris.  This implements the subset of
12// the xlocale APIs that libc++ depends on.
13////////////////////////////////////////////////////////////////////////////////
14#ifndef __XLOCALE_H_INCLUDED
15#define __XLOCALE_H_INCLUDED
16
17#include <stdlib.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23
24int snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...);
25int asprintf_l(char **__s, locale_t __l, const char *__format, ...);
26
27int sscanf_l(const char *__s, locale_t __l, const char *__format, ...);
28
29int toupper_l(int __c, locale_t __l);
30int tolower_l(int __c, locale_t __l);
31
32struct lconv *localeconv(void);
33struct lconv *localeconv_l(locale_t __l);
34
35// FIXME: These are quick-and-dirty hacks to make things pretend to work
36static inline
37long long strtoll_l(const char *__nptr, char **__endptr,
38    int __base, locale_t __loc) {
39  return strtoll(__nptr, __endptr, __base);
40}
41static inline
42long strtol_l(const char *__nptr, char **__endptr,
43    int __base, locale_t __loc) {
44  return strtol(__nptr, __endptr, __base);
45}
46static inline
47unsigned long long strtoull_l(const char *__nptr, char **__endptr,
48    int __base, locale_t __loc) {
49  return strtoull(__nptr, __endptr, __base);
50}
51static inline
52unsigned long strtoul_l(const char *__nptr, char **__endptr,
53    int __base, locale_t __loc) {
54  return strtoul(__nptr, __endptr, __base);
55}
56static inline
57float strtof_l(const char *__nptr, char **__endptr,
58    locale_t __loc) {
59  return strtof(__nptr, __endptr);
60}
61static inline
62double strtod_l(const char *__nptr, char **__endptr,
63    locale_t __loc) {
64  return strtod(__nptr, __endptr);
65}
66static inline
67long double strtold_l(const char *__nptr, char **__endptr,
68    locale_t __loc) {
69  return strtold(__nptr, __endptr);
70}
71
72
73#ifdef __cplusplus
74}
75#endif
76
77#endif
78