提交 285c3233 编写于 作者: A Anton Perkov

compile stdio

上级 859df478
......@@ -5,6 +5,7 @@
typedef size_t ssize_t;
typedef __builtin_va_list va_list;
typedef __builtin_va_list __isoc_va_list;
typedef unsigned long wctype_t;
......
......@@ -43,3 +43,21 @@ typedef __uintn_t(__INTPTR_WIDTH__) uintptr_t;
typedef __INTMAX_TYPE__ intmax_t;
typedef __UINTMAX_TYPE__ uintmax_t;
// musl/x86_64/bits/stdint.h
#define INT_FAST16_MIN INT32_MIN
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST16_MAX INT32_MAX
#define INT_FAST32_MAX INT32_MAX
#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define INTPTR_MIN INT64_MIN
#define INTPTR_MAX INT64_MAX
#define UINTPTR_MAX UINT64_MAX
#define PTRDIFF_MIN INT64_MIN
#define PTRDIFF_MAX INT64_MAX
#define SIZE_MAX UINT64_MAX
......@@ -51,7 +51,7 @@ typedef union _G_fpos64_t {
char __opaque[16];
double __align;
} fpos_t;
/*
extern FILE *const stdin;
extern FILE *const stdout;
extern FILE *const stderr;
......@@ -60,8 +60,8 @@ extern FILE *const stderr;
#define stdout (stdout)
#define stderr (stderr)
FILE *fopen(const char *__restrict, const char *__restrict);
FILE *freopen(const char *__restrict, const char *__restrict, FILE *__restrict);
//FILE *fopen(const char *__restrict, const char *__restrict);
//FILE *freopen(const char *__restrict, const char *__restrict, FILE *__restrict);
int fclose(FILE *);
int remove(const char *);
......@@ -98,32 +98,24 @@ char *gets(char *);
int fputs(const char *__restrict, FILE *__restrict);
int puts(const char *);
*/
int printf(const char *__restrict, ...);
/*
int fprintf(FILE *__restrict, const char *__restrict, ...);
*/
int sprintf(char *__restrict, const char *__restrict, ...);
int snprintf(char *__restrict, size_t, const char *__restrict, ...);
int vprintf(const char *__restrict, __isoc_va_list);
/*
int vfprintf(FILE *__restrict, const char *__restrict, __isoc_va_list);
*/
int vsprintf(char *__restrict, const char *__restrict, __isoc_va_list);
int vsnprintf(char *__restrict, size_t, const char *__restrict, __isoc_va_list);
int scanf(const char *__restrict, ...);
/*
int fscanf(FILE *__restrict, const char *__restrict, ...);
*/
int sscanf(const char *__restrict, const char *__restrict, ...);
int vscanf(const char *__restrict, __isoc_va_list);
/*
int vfscanf(FILE *__restrict, const char *__restrict, __isoc_va_list);
*/
int vsscanf(const char *__restrict, const char *__restrict, __isoc_va_list);
/*
void perror(const char *);
int setvbuf(FILE *__restrict, char *__restrict, int, size_t);
......@@ -138,8 +130,8 @@ FILE *tmpfile(void);
FILE *fmemopen(void *__restrict, size_t, const char *__restrict);
FILE *open_memstream(char **, size_t *);
FILE *fdopen(int, const char *);
FILE *popen(const char *, const char *);
int pclose(FILE *);
//FILE *popen(const char *, const char *);
//int pclose(FILE *);
int fileno(FILE *);
int fseeko(FILE *, off_t, int);
off_t ftello(FILE *);
......@@ -217,7 +209,7 @@ FILE *fopencookie(void *, const char *, cookie_io_functions_t);
#define fpos64_t fpos_t
#define off64_t off_t
#endif
*/
#ifdef __cplusplus
}
#endif
......
#ifndef _STDIO_EXT_H
#define _STDIO_EXT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#define FSETLOCKING_QUERY 0
#define FSETLOCKING_INTERNAL 1
#define FSETLOCKING_BYCALLER 2
void _flushlbf(void);
int __fsetlocking(FILE *, int);
int __fwriting(FILE *);
int __freading(FILE *);
int __freadable(FILE *);
int __fwritable(FILE *);
int __flbf(FILE *);
size_t __fbufsize(FILE *);
size_t __fpending(FILE *);
int __fpurge(FILE *);
size_t __freadahead(FILE *);
const char *__freadptr(FILE *, size_t *);
void __freadptrinc(FILE *, size_t);
void __fseterr(FILE *);
#ifdef __cplusplus
}
#endif
#endif
......@@ -97,9 +97,8 @@ unsigned long wcstoul (const wchar_t *__restrict, wchar_t **__restrict, int);
long long wcstoll (const wchar_t *__restrict, wchar_t **__restrict, int);
unsigned long long wcstoull (const wchar_t *__restrict, wchar_t **__restrict, int);
/*
int fwide (FILE *, int);
int fwide (FILE *, int);
int wprintf (const wchar_t *__restrict, ...);
int fwprintf (FILE *__restrict, const wchar_t *__restrict, ...);
......@@ -115,6 +114,7 @@ int swscanf (const wchar_t *__restrict, const wchar_t *__restrict, ...);
int vwscanf (const wchar_t *__restrict, __isoc_va_list);
int vfwscanf (FILE *__restrict, const wchar_t *__restrict, __isoc_va_list);
int vswscanf (const wchar_t *__restrict, const wchar_t *__restrict, __isoc_va_list);
wint_t fgetwc (FILE *);
......@@ -136,6 +136,7 @@ size_t wcsftime (wchar_t *__restrict, size_t, const wchar_t *__restrict, const s
#undef iswdigit
#if defined(_GNU_SOURCE)
wint_t fgetwc_unlocked (FILE *);
wint_t getwc_unlocked (FILE *);
wint_t getwchar_unlocked (void);
......@@ -144,12 +145,12 @@ wint_t putwc_unlocked (wchar_t, FILE *);
wint_t putwchar_unlocked (wchar_t);
wchar_t *fgetws_unlocked (wchar_t *__restrict, int, FILE *__restrict);
int fputws_unlocked (const wchar_t *__restrict, FILE *__restrict);
#endif
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
size_t wcsftime_l (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict, locale_t);
#endif
*/
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
......
......@@ -3,6 +3,7 @@ file(GLOB CTYPE_SOURCES "ctype/*.c")
file(GLOB ERRNO_SOURCES "errno/*.c")
file(GLOB MBYTE_SOURCES "multibyte/*.c")
file(GLOB SEARCH_SOURCES "search/*.c")
file(GLOB STDLIB_SOURCES "stdio/*.c")
file(GLOB STDLIB_SOURCES "stdlib/*.c")
file(GLOB STRING_SOURCES "string/*.c")
......
......@@ -49,10 +49,10 @@ extern char *__progname, *__progname_full;
/* Designed to avoid any overhead in non-threaded processes */
void __lock(volatile int *) ATTR_LIBC_VISIBILITY;
void __unlock(volatile int *) ATTR_LIBC_VISIBILITY;
/*
int __lockfile(FILE *) ATTR_LIBC_VISIBILITY;
void __unlockfile(FILE *) ATTR_LIBC_VISIBILITY;
*/
#define LOCK(x) __lock(x)
#define UNLOCK(x) __unlock(x)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册