procuding a (non-working) executable for tcc
This commit is contained in:
parent
6e1158f49a
commit
e900dd8d6f
71 changed files with 42663 additions and 96 deletions
28
05/stdio.h
28
05/stdio.h
|
@ -1699,6 +1699,12 @@ FILE *fopen(const char *filename, const char *mode) {
|
|||
return _FILE_from_fd(fd);
|
||||
}
|
||||
|
||||
|
||||
FILE *fdopen(int fd, const char *mode) {
|
||||
// mode doesn't matter, hopefully
|
||||
return _FILE_from_fd(fd);
|
||||
}
|
||||
|
||||
int fclose(FILE *stream) {
|
||||
int ret = close(stream->fd);
|
||||
free(stream);
|
||||
|
@ -1932,28 +1938,6 @@ int _file_peek_char(void *dat) {
|
|||
return c;
|
||||
}
|
||||
|
||||
int _clamp_long_to_int(long x) {
|
||||
if (x < INT_MIN) return INT_MIN;
|
||||
if (x > INT_MAX) return INT_MAX;
|
||||
return x;
|
||||
}
|
||||
|
||||
short _clamp_long_to_short(long x) {
|
||||
if (x < SHRT_MIN) return SHRT_MIN;
|
||||
if (x > SHRT_MAX) return SHRT_MAX;
|
||||
return x;
|
||||
}
|
||||
|
||||
unsigned _clamp_ulong_to_uint(unsigned long x) {
|
||||
if (x > UINT_MAX) return UINT_MAX;
|
||||
return x;
|
||||
}
|
||||
|
||||
unsigned short _clamp_ulong_to_ushort(unsigned long x) {
|
||||
if (x > USHRT_MAX) return USHRT_MAX;
|
||||
return x;
|
||||
}
|
||||
|
||||
void _bad_scanf(void) {
|
||||
fprintf(stderr, "bad scanf format.\n");
|
||||
abort();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue