From 69cce6c2778e8ec8b02e2b7c27818d75ae74e2d6 Mon Sep 17 00:00:00 2001 From: Andre Leiradella Date: Sun, 7 Jun 2015 21:21:57 -0300 Subject: [PATCH] use fseek/ftell beacuse of msvc --- libretro-db/libretrodb.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libretro-db/libretrodb.c b/libretro-db/libretrodb.c index 9523582d94..b3c2ed170f 100644 --- a/libretro-db/libretrodb.c +++ b/libretro-db/libretrodb.c @@ -28,10 +28,11 @@ struct node_iter_ctx static struct rmsgpack_dom_value sentinal; -static inline off_t flseek(FILE *fp, off_t offset, int whence) +static inline off_t flseek(FILE *fp, int offset, int whence) { - fseeko(fp, offset, whence); - return ftello(fp); + if (fseek(fp, offset, whence) != 0) + return (off_t)-1; + return (off_t)ftell(fp); } static int libretrodb_read_metadata(FILE *fp, libretrodb_metadata_t *md) @@ -395,7 +396,7 @@ static int node_iter(void * value, void * ctx) static uint64_t libretrodb_tell(libretrodb_t *db) { - return ftello(db->fp); + return (uint64_t)ftell(db->fp); } int libretrodb_create_index(libretrodb_t *db,