libc: Make fpos_t no longer a struct
This commit is contained in:
parent
9bbb5d0c07
commit
759c8a8cab
@ -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"
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user