summaryrefslogtreecommitdiff
path: root/chromium/buildtools/third_party/libc++/trunk/src/support/solaris/xlocale.c
blob: 9125eea73777f5fbf5e3b89dbc13f854ba8a980e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifdef __sun__

#include "support/solaris/xlocale.h"
#include <stdarg.h>
#include <stdio.h>
#include <sys/localedef.h>


int isxdigit_l(int __c, locale_t __l) {
    return isxdigit(__c);
}

int iswxdigit_l(wchar_t __c, locale_t __l) {
    return isxdigit(__c);
}

// FIXME: This disregards the locale, which is Very Wrong
#define vsnprintf_l(__s, __n, __l, __format, __va)  \
    vsnprintf(__s, __n, __format, __va) 

int snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...)
{
  va_list __va;
  va_start(__va, __format);
  int __res = vsnprintf_l(__s, __n , __l, __format, __va);
  va_end(__va);
  return __res;
}

int asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
  va_list __va;
  va_start(__va, __format);
  // FIXME:
  int __res = vasprintf(__s, __format, __va);
  va_end(__va);
  return __res;
}

int sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
  va_list __va;
  va_start(__va, __format);
  // FIXME:
  int __res = vsscanf(__s, __format, __va);
  va_end(__va);
  return __res;
}

size_t mbrtowc_l(wchar_t *__pwc, const char *__pmb,
                 size_t __max, mbstate_t *__ps, locale_t __loc) {
  return mbrtowc(__pwc, __pmb, __max, __ps);
}

struct lconv *localeconv_l(locale_t __l) {
  return localeconv();
}

#endif // __sun__