Minor tweaks to get miniz.c compiling with tcc (Tiny C Compiler)

This commit is contained in:
richgel99@gmail.com
2012-05-20 23:33:13 +00:00
parent f28a343dfa
commit e842d2de5e

24
miniz.c
View File

@@ -2795,7 +2795,9 @@ void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h,
#include <stdio.h> #include <stdio.h>
#include <sys/stat.h> #include <sys/stat.h>
#if defined(_MSC_VER) || defined(__MINGW64__) #if defined(_MSC_VER) || defined(__MINGW64__)
#ifndef MINIZ_NO_TIME
#include <sys/utime.h> #include <sys/utime.h>
#endif
#define MZ_FILE FILE #define MZ_FILE FILE
#define MZ_FOPEN fopen #define MZ_FOPEN fopen
#define MZ_FCLOSE fclose #define MZ_FCLOSE fclose
@@ -2809,7 +2811,9 @@ void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h,
#define MZ_FREOPEN freopen #define MZ_FREOPEN freopen
#define MZ_DELETE_FILE remove #define MZ_DELETE_FILE remove
#elif defined(__MINGW32__) #elif defined(__MINGW32__)
#ifndef MINIZ_NO_TIME
#include <sys/utime.h> #include <sys/utime.h>
#endif
#define MZ_FILE FILE #define MZ_FILE FILE
#define MZ_FOPEN fopen #define MZ_FOPEN fopen
#define MZ_FCLOSE fclose #define MZ_FCLOSE fclose
@@ -2822,8 +2826,26 @@ void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h,
#define MZ_FFLUSH fflush #define MZ_FFLUSH fflush
#define MZ_FREOPEN freopen #define MZ_FREOPEN freopen
#define MZ_DELETE_FILE remove #define MZ_DELETE_FILE remove
#elif defined(__TINYC__)
#ifndef MINIZ_NO_TIME
#include <sys\utime.h>
#endif
#define MZ_FILE FILE
#define MZ_FOPEN fopen
#define MZ_FCLOSE fclose
#define MZ_FREAD fread
#define MZ_FWRITE fwrite
#define MZ_FTELL64 ftell
#define MZ_FSEEK64 fseek
#define MZ_FILE_STAT_STRUCT stat
#define MZ_FILE_STAT stat
#define MZ_FFLUSH fflush
#define MZ_FREOPEN freopen
#define MZ_DELETE_FILE remove
#else #else
#ifndef MINIZ_NO_TIME
#include <utime.h> #include <utime.h>
#endif
#define MZ_FILE FILE #define MZ_FILE FILE
#define MZ_FOPEN fopen #define MZ_FOPEN fopen
#define MZ_FCLOSE fclose #define MZ_FCLOSE fclose
@@ -2958,7 +2980,7 @@ static mz_bool mz_zip_set_file_times(const char *pFilename, time_t access_time,
struct utimbuf t; t.actime = access_time; t.modtime = modified_time; struct utimbuf t; t.actime = access_time; t.modtime = modified_time;
return !utime(pFilename, &t); return !utime(pFilename, &t);
#else #else
pFilename, access_time, modified_time; (void)pFilename, (void)access_time, (void)modified_time;
return MZ_TRUE; return MZ_TRUE;
#endif // #ifndef MINIZ_NO_TIME #endif // #ifndef MINIZ_NO_TIME
} }