some stuff to get further in python builds

This commit is contained in:
K. Lange 2018-05-09 17:02:31 +09:00
parent 643049ff32
commit b23d7a2930
6 changed files with 25 additions and 0 deletions

View File

@ -13,3 +13,6 @@ extern int isupper(int c);
extern int isxdigit(int c);
extern int isascii(int c);
extern int tolower(int c);
extern int toupper(int c);

View File

@ -9,3 +9,5 @@ extern double sqrt(double x);
extern double fabs(double x);
extern double sin(double x);
extern double cos(double x);
#define HUGE_VAL (__builtin_huge_val())

View File

@ -48,3 +48,6 @@ extern void perror(const char *s);
extern int ungetc(int c, FILE * stream);
extern int feof(FILE * stream);
extern void clearerr(FILE * stream);
#define getc(s) fgetc(s)

6
libc/ctype/tolower.c Normal file
View File

@ -0,0 +1,6 @@
int tolower(int c) {
if (c >= 'A' && c <= 'Z') {
return c - 'A' + 'a';
}
return c;
}

7
libc/ctype/toupper.c Normal file
View File

@ -0,0 +1,7 @@
int toupper(int c) {
if (c >= 'a' && c <= 'z') {
return c - 'a' + 'A';
}
return c;
}

View File

@ -331,3 +331,7 @@ void setbuf(FILE * stream, char * buf) {
int feof(FILE * stream) {
return stream->eof;
}
void clearerr(FILE * stream) {
stream->eof = 0;
}