summaryrefslogtreecommitdiff
path: root/src/stubs.cpp
blob: 8fcc4defa351748611edb981ca4c314ec2db05b5 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// -*- C++ -*-
//===----------------------------- stubs.cpp ------------------------------===//
//
//                     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 __ANDROID__

#ifdef __cplusplus
extern "C" {
#endif

#include <errno.h>
#include <stdlib.h>
#include <wchar.h>

#include <support/android/nl_types.h>

static void unimplemented_stub(const char* function) {
    const char* fmt = "%s(3) is stubbed out in libcxx\n";
    fprintf(stderr, fmt, function);
#if 0 // Enable if you're trying to find out who's calling...
    abort();
#endif
}

#define UNIMPLEMENTED unimplemented_stub(__PRETTY_FUNCTION__)

float wcstof(const wchar_t *, wchar_t **)
{
    UNIMPLEMENTED;
    return 0;
}

long double wcstold(const wchar_t *, wchar_t **)
{
    UNIMPLEMENTED;
    return 0;
}

long long wcstoll(const wchar_t *, wchar_t **, int)
{
    UNIMPLEMENTED;
    return 0;
}

unsigned long long wcstoull(const wchar_t *, wchar_t **, int)
{
    UNIMPLEMENTED;
    return 0;
}

size_t wcsnrtombs(char *, const wchar_t **, size_t, size_t, mbstate_t *)
{
    UNIMPLEMENTED;
    errno = EILSEQ;
    return (size_t)-1;
}

size_t mbsnrtowcs(wchar_t *, const char **, size_t, size_t, mbstate_t *)
{
    UNIMPLEMENTED;
    errno = EILSEQ;
    return (size_t)-1;
}

int mbtowc(wchar_t *, const char *, size_t)
{
    UNIMPLEMENTED;
    return -1;
}

nl_catd catopen(const char *, int)
{
    UNIMPLEMENTED;
    return (nl_catd)-1;
}

int catclose(nl_catd)
{
    UNIMPLEMENTED;
    return -1;
}

char *catgets(nl_catd, int, int, const char *message)
{
    UNIMPLEMENTED;
    return (char *)message;
}

#ifdef __cplusplus
}
#endif

#endif // __ANDROID__