file.h is now stdio.h-free
This commit is contained in:
parent
a0d6c5800c
commit
20cb77bbbe
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include "picrin.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
PIC_NORETURN static void
|
||||
file_error(pic_state *pic, const char *msg)
|
||||
{
|
||||
|
|
|
@ -50,9 +50,9 @@ foreach my $file (@ARGV) {
|
|||
}
|
||||
pic_catch {
|
||||
/* error! */
|
||||
fputs("fatal error: failure in loading $dirname/$basename\\n", stderr);
|
||||
fputs(pic_errmsg(pic), stderr);
|
||||
abort();
|
||||
xfputs(pic, "fatal error: failure in loading $dirname/$basename\\n", xstderr);
|
||||
xfputs(pic, pic_errmsg(pic), xstderr);
|
||||
pic_panic(pic, "load error");
|
||||
}
|
||||
EOL
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ int x_flushbuf(pic_state *pic, int x, xFILE *fp) {
|
|||
}
|
||||
|
||||
fp->ptr = fp->base;
|
||||
fp->cnt = BUFSIZ - 1;
|
||||
fp->cnt = XBUFSIZ - 1;
|
||||
}
|
||||
|
||||
if (num_written == bufsize) {
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef EOF
|
||||
# define EOF (-1)
|
||||
#endif
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include "picrin.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
pic_value
|
||||
pic_eof_object()
|
||||
{
|
||||
|
@ -69,7 +71,10 @@ file_seek(pic_state PIC_UNUSED(*pic), void *cookie, long pos, int whence) {
|
|||
whence = SEEK_END;
|
||||
break;
|
||||
}
|
||||
return fseek(cookie, pos, whence);
|
||||
if (fseek(cookie, pos, whence) == 0) {
|
||||
return ftell(cookie);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue