diff --git a/cocos/platform/CCImage.cpp b/cocos/platform/CCImage.cpp index 44de338ef4..91bd8162f9 100644 --- a/cocos/platform/CCImage.cpp +++ b/cocos/platform/CCImage.cpp @@ -39,6 +39,24 @@ THE SOFTWARE. extern "C" { +#if defined(__APPLE__) || defined(__unix) +#ifndef __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ +#define __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ +#include + FILE *fopen$UNIX2003( const char *filename, const char *mode ) + { + return fopen(filename, mode); + } + size_t fwrite$UNIX2003( const void *a, size_t b, size_t c, FILE *d ) + { + return fwrite(a, b, c, d); + } + char *strerror$UNIX2003( int errnum ) + { + return strerror(errnum); + } +#endif +#endif #include "png.h" #include "tiffio.h" #include "base/etc1.h"