1/*
2 * Copyright (C) 2009 The Android Open Source Project
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *  * Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 *  * Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in
12 *    the documentation and/or other materials provided with the
13 *    distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29#include <cstdio>
30#if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CSTDIO__
31#error "Wrong header file included!!"
32#endif
33
34namespace {
35const int kPassed = 0;
36const int kFailed = 1;
37#define FAIL_UNLESS(f) if (!android::f()) return kFailed;
38}  // anonymous namespace
39
40namespace android
41{
42#ifndef BUFSIZ
43#error "BUFSIZ must be a macro"
44#endif
45
46#ifndef EOF
47#error "EOF must be a macro"
48#endif
49
50#ifndef FILENAME_MAX
51#error "FILENAME_MAX must be a macro"
52#endif
53
54#ifndef FOPEN_MAX
55#error "FOPEN_MAX must be a macro"
56#endif
57
58#ifndef L_tmpnam
59#error "L_tmpnam must be a macro"
60#endif
61
62#ifndef NULL
63#error "NULL must be a macro"
64#endif
65
66#ifndef SEEK_CUR
67#error "SEEK_CUR must be a macro"
68#endif
69
70#ifndef SEEK_END
71#error "SEEK_END must be a macro"
72#endif
73#ifndef SEEK_SET
74#error "SEEK_SET must be a macro"
75#endif
76
77#ifndef TMP_MAX
78#error "TMP_MAX must be a macro"
79#endif
80
81#ifndef _IOFBF
82#error "_IOFBF must be a macro"
83#endif
84
85#ifndef _IOLBF
86#error "_IOLBF must be a macro"
87#endif
88
89#ifndef _IONBF
90#error "_IONBF must be a macro"
91#endif
92
93#ifndef stderr
94#error "stderr must be a macro"
95#endif
96
97#ifndef stdin
98#error "stdin must be a macro"
99#endif
100
101#ifndef stdout
102#error "stdout must be a macro"
103#endif
104
105using std::clearerr;
106using std::fclose;
107using std::feof;
108using std::ferror;
109using std::fflush;
110using std::fgetc;
111using std::fgetpos;
112using std::fgets;
113using std::fopen;
114using std::fprintf;
115using std::fputc;
116using std::fputs;
117using std::fread;
118using std::freopen;
119using std::fscanf;
120using std::fseek;
121using std::fsetpos;
122using std::ftell;
123using std::fwrite;
124using std::getc;
125using std::getchar;
126using std::gets;
127using std::perror;
128using std::printf;
129using std::putc;
130using std::putchar;
131using std::puts;
132using std::remove;
133using std::rename;
134using std::rewind;
135using std::scanf;
136using std::setbuf;
137using std::setvbuf;
138using std::sprintf;
139using std::sscanf;
140using std::tmpfile;
141using std::tmpnam;
142using std::ungetc;
143using std::vfprintf;
144using std::vprintf;
145using std::vsprintf;
146
147using std::snprintf;
148using std::vfscanf;
149using std::vscanf;
150using std::vsnprintf;
151using std::vsscanf;
152
153bool testTypesStd()
154{
155    volatile std::size_t size;
156    volatile std::FILE file;
157    volatile std::fpos_t fpos_t;
158    return true;
159}
160}  // namespace android
161
162int main(int argc, char **argv)
163{
164    FAIL_UNLESS(testTypesStd);
165    return kPassed;
166}
167