mirror of
https://github.com/Fennix-Project/Userspace.git
synced 2025-05-27 15:04:25 +00:00
Update libc
This commit is contained in:
parent
f48511c6ff
commit
f2abcdd15d
@ -26,6 +26,9 @@ extern "C"
|
|||||||
extern FILE *stdin;
|
extern FILE *stdin;
|
||||||
extern FILE *stdout;
|
extern FILE *stdout;
|
||||||
extern FILE *stderr;
|
extern FILE *stderr;
|
||||||
|
#define stdin stdin
|
||||||
|
#define stdout stdout
|
||||||
|
#define stderr stderr
|
||||||
|
|
||||||
FILE *fopen(const char *filename, const char *mode);
|
FILE *fopen(const char *filename, const char *mode);
|
||||||
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
|
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
|
||||||
@ -44,8 +47,8 @@ extern "C"
|
|||||||
int fputc(int c, FILE *stream);
|
int fputc(int c, FILE *stream);
|
||||||
int putc(int c, FILE *stream);
|
int putc(int c, FILE *stream);
|
||||||
int fputs(const char *s, FILE *stream);
|
int fputs(const char *s, FILE *stream);
|
||||||
int putchar(int c);
|
|
||||||
int puts(const char *s);
|
int puts(const char *s);
|
||||||
|
int putchar(int c);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ extern "C"
|
|||||||
|
|
||||||
double atof(const char *nptr);
|
double atof(const char *nptr);
|
||||||
|
|
||||||
extern void perror(const char *__s);
|
extern void perror(const char *s);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,11 @@ endif
|
|||||||
|
|
||||||
CFLAGS := -fPIC -I$(INCLUDE) -I$(INCLUDE2)
|
CFLAGS := -fPIC -I$(INCLUDE) -I$(INCLUDE2)
|
||||||
|
|
||||||
|
ifeq ($(DEBUG), 1)
|
||||||
|
CFLAGS += -DDEBUG -ggdb3 -O0 -fdiagnostics-color=always -fverbose-asm
|
||||||
|
# LDFLAGS += -ggdb3 -O0
|
||||||
|
endif
|
||||||
|
|
||||||
build: $(OBJECT_NAME)
|
build: $(OBJECT_NAME)
|
||||||
|
|
||||||
$(OBJECT_NAME): $(OBJ)
|
$(OBJECT_NAME): $(OBJ)
|
||||||
|
@ -59,11 +59,6 @@ int fprintf(FILE *stream, const char *format, ...)
|
|||||||
return 0; // sprintf(char *s, const char *format, ...)
|
return 0; // sprintf(char *s, const char *format, ...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// int printf(const char *format, ...)
|
|
||||||
// {
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
void setbuf(FILE *stream, char *buf)
|
void setbuf(FILE *stream, char *buf)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
int fputc(int c, FILE *stream)
|
int fputc(int c, FILE *stream)
|
||||||
{
|
{
|
||||||
syscall1(_Print, c);
|
return syscall1(_Print, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
int putc(int c, FILE *stream)
|
int putc(int c, FILE *stream)
|
||||||
{
|
{
|
||||||
syscall1(_Print, c);
|
return syscall1(_Print, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
int fputs(const char *s, FILE *stream)
|
int fputs(const char *s, FILE *stream)
|
||||||
@ -18,18 +18,18 @@ int fputs(const char *s, FILE *stream)
|
|||||||
fputc(s[i], stream);
|
fputc(s[i], stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
int putchar(int c)
|
|
||||||
{
|
|
||||||
syscall1(_Print, c);
|
|
||||||
}
|
|
||||||
|
|
||||||
int puts(const char *s)
|
int puts(const char *s)
|
||||||
{
|
{
|
||||||
for (int i = 0; s[i] != '\0'; i++)
|
for (int i = 0; s[i] != '\0'; i++)
|
||||||
fputc(s[i], stdout);
|
fputc(s[i], stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void perror(const char *__s)
|
int putchar(int c)
|
||||||
{
|
{
|
||||||
fputs(__s, stderr);
|
return putc(c, stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void perror(const char *s)
|
||||||
|
{
|
||||||
|
fputs(s, stderr);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user