common: add fs_size_t typedef, for read()/write() return value

This commit is contained in:
Alibek Omarov 2021-12-23 01:21:33 +03:00
parent d8b3ab4dcc
commit 764ef93984
3 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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
{

View File

@ -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 );