Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions fmemopen.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
#include <string.h>
#include <sys/mman.h>

#if defined(__NetBSD__)
# define FPOS_T off_t
#else
# define FPOS_T fpos_t
#endif

struct fmem {
size_t pos;
size_t size;
Expand Down Expand Up @@ -53,7 +59,7 @@ static int writefn(void *handler, const char *buf, int size) {
return size;
}

static fpos_t seekfn(void *handler, fpos_t offset, int whence) {
static FPOS_T seekfn(void *handler, FPOS_T offset, int whence) {
size_t pos;
fmem_t *mem = handler;

Expand Down Expand Up @@ -83,7 +89,7 @@ static fpos_t seekfn(void *handler, fpos_t offset, int whence) {
}

mem->pos = pos;
return (fpos_t)pos;
return (FPOS_T)pos;
}

static int closefn(void *handler) {
Expand Down
Loading