]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/SDKs/darwin/usr/include/stdio.h
1 /* ===-- stdio.h - stub SDK header for compiler-rt --------------------------===
3 * The LLVM Compiler Infrastructure
5 * This file is dual licensed under the MIT and the University of Illinois Open
6 * Source Licenses. See LICENSE.TXT for details.
8 * ===-----------------------------------------------------------------------===
10 * This is a stub SDK header file. This file is not part of the interface of
11 * this library nor an official version of the appropriate SDK header. It is
12 * intended only to stub the features of this header required by compiler-rt.
14 * ===-----------------------------------------------------------------------===
20 #if defined(__cplusplus)
24 typedef struct __sFILE
FILE;
25 typedef __SIZE_TYPE__
size_t;
27 /* Determine the appropriate fdopen, fopen(), and fwrite() functions. */
28 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
30 # define __FDOPEN_NAME "_fdopen$UNIX2003"
31 # define __FOPEN_NAME "_fopen$UNIX2003"
32 # define __FWRITE_NAME "_fwrite$UNIX2003"
33 # elif defined(__x86_64__)
34 # define __FDOPEN_NAME "_fdopen"
35 # define __FOPEN_NAME "_fopen"
36 # define __FWRITE_NAME "_fwrite"
38 # define __FDOPEN_NAME "_fdopen"
39 # define __FOPEN_NAME "_fopen"
40 # define __FWRITE_NAME "_fwrite"
42 # error "unrecognized architecture for targetting OS X"
44 #elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
45 # if defined(__i386) || defined (__x86_64)
46 # define __FDOPEN_NAME "_fdopen"
47 # define __FOPEN_NAME "_fopen"
48 # define __FWRITE_NAME "_fwrite"
50 # define __FDOPEN_NAME "_fdopen"
51 # define __FOPEN_NAME "_fopen"
52 # define __FWRITE_NAME "_fwrite"
54 # error "unrecognized architecture for targetting iOS"
57 # error "unrecognized architecture for targetting Darwin"
60 # define stderr __stderrp
61 extern FILE *__stderrp
;
64 #define SEEK_SET 0 /* set file offset to offset */
67 #define SEEK_CUR 1 /* set file offset to current plus offset */
70 #define SEEK_END 2 /* set file offset to EOF plus offset */
75 FILE *fopen(const char * __restrict
, const char * __restrict
) __asm(__FOPEN_NAME
);
76 FILE *fdopen(int, const char *) __asm(__FDOPEN_NAME
);
77 int fprintf(FILE * __restrict
, const char * __restrict
, ...);
78 int fputc(int, FILE *);
79 size_t fwrite(const void * __restrict
, size_t, size_t, FILE * __restrict
)
81 size_t fread(void * __restrict
, size_t, size_t, FILE * __restrict
);
83 int fseek(FILE *, long, int);
84 int snprintf(char * __restrict
, size_t, const char * __restrict
, ...);
86 #if defined(__cplusplus)
90 #endif /* __STDIO_H__ */