diff --git a/common/port.h b/common/port.h index 183f1fe7..9b6317ce 100644 --- a/common/port.h +++ b/common/port.h @@ -137,6 +137,7 @@ GNU General Public License for more details. #define HAVE_DUP #endif //WIN32 + #ifndef XASH_LOW_MEMORY #define XASH_LOW_MEMORY 0 #endif diff --git a/common/xash3d_types.h b/common/xash3d_types.h index e1d1a0ae..809da0ad 100644 --- a/common/xash3d_types.h +++ b/common/xash3d_types.h @@ -117,6 +117,11 @@ typedef struct file_s file_t; // normal file typedef struct wfile_s wfile_t; // wad file typedef struct stream_s stream_t; // sound stream for background music playing typedef off_t fs_offset_t; +#if XASH_WIN32 +typedef int fs_size_t; // return type of _read, _write funcs +#else /* !XASH_WIN32 */ +typedef ssize_t fs_size_t; +#endif /* !XASH_WIN32 */ typedef struct dllfunc_s { diff --git a/engine/common/filesystem.c b/engine/common/filesystem.c index 51e03f04..ff1139c3 100644 --- a/engine/common/filesystem.c +++ b/engine/common/filesystem.c @@ -606,7 +606,7 @@ pack_t *FS_LoadPackPAK( const char *packfile, int *error ) int i, numpackfiles; pack_t *pack; dpackfile_t *info; - ssize_t c; + fs_size_t c; packhandle = open( packfile, O_RDONLY|O_BINARY ); @@ -722,7 +722,7 @@ static zip_t *FS_LoadZip( const char *zipfile, int *error ) zipfile_t *info = NULL; char filename_buffer[MAX_SYSPATH]; zip_t *zip = (zip_t *)Mem_Calloc( fs_mempool, sizeof( *zip )); - ssize_t c; + fs_size_t c; zip->handle = open( zipfile, O_RDONLY|O_BINARY );