From 9a40529ae74507da20c5e414f8cd7073b83733e8 Mon Sep 17 00:00:00 2001 From: Basem Abughallya Date: Sat, 29 Dec 2018 17:41:41 +0100 Subject: [PATCH] utils: declare funopen only on Android MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit funopen is only needed on Android, so declare it only there. This fixes following MinGW build failure: utils.c:50:7: error: conflicting types for ‘funopen’ FILE *funopen(const void *cookie, int (*readfn)(void *, char *, int), ^~~~~~~ In file included from utils.c:45:0: /usr/include/stdio.h:586:7: note: previous declaration of ‘funopen’ was here FILE *funopen (const void *__cookie, ^~~~~~~ --- src/utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils.c b/src/utils.c index b2951040c..e891ef72e 100644 --- a/src/utils.c +++ b/src/utils.c @@ -46,11 +46,6 @@ #include // Required for: va_list, va_start(), vfprintf(), va_end() #include // Required for: strlen(), strrchr(), strcmp() -/* This should be in , but Travis doesn't find it... */ -FILE *funopen(const void *cookie, int (*readfn)(void *, char *, int), - int (*writefn)(void *, const char *, int), - fpos_t (*seekfn)(void *, fpos_t, int), int (*closefn)(void *)); - //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- @@ -67,6 +62,11 @@ AAssetManager *assetManager; // Module specific Functions Declaration //---------------------------------------------------------------------------------- #if defined(PLATFORM_ANDROID) +/* This should be in , but Travis doesn't find it... */ +FILE *funopen(const void *cookie, int (*readfn)(void *, char *, int), + int (*writefn)(void *, const char *, int), + fpos_t (*seekfn)(void *, fpos_t, int), int (*closefn)(void *)); + static int android_read(void *cookie, char *buf, int size); static int android_write(void *cookie, const char *buf, int size); static fpos_t android_seek(void *cookie, fpos_t offset, int whence);