libc: Make fpos_t no longer a struct

This commit is contained in:
apio 2022-10-22 12:39:37 +02:00
parent 9bbb5d0c07
commit 759c8a8cab
2 changed files with 4 additions and 6 deletions

View File

@ -3,6 +3,7 @@
#include <stdarg.h>
#include <stddef.h>
#include <sys/types.h>
#include <bits/seek.h>
@ -28,10 +29,7 @@ extern FILE* stdin;
#define EOF -1
typedef struct
{
long f_offset;
} fpos_t;
typedef off_t fpos_t;
#ifdef __cplusplus
extern "C"

View File

@ -194,7 +194,7 @@ extern "C"
int fsetpos(FILE* stream, const fpos_t* pos)
{
return fseek(stream, pos->f_offset, SEEK_SET);
return fseek(stream, *pos, SEEK_SET);
}
long ftell(FILE* stream)
@ -208,7 +208,7 @@ extern "C"
{
long result = ftell(stream);
if (result < 0) { return -1; }
pos->f_offset = result;
*pos = result;
return 0;
}