Fixed windows ad.exe build

This commit is contained in:
arrai 2008-10-30 23:12:02 +01:00
parent 0bf682fdbd
commit b724ae2fe4
2 changed files with 7 additions and 1 deletions

View file

@ -49,6 +49,12 @@
#include <io.h>
#endif
#ifdef O_LARGEFILE
#define MPQ_FILE_OPEN_FLAGS (O_RDONLY | O_BINARY | O_LARGEFILE)
#else
#define MPQ_FILE_OPEN_FLAGS (O_RDONLY | O_BINARY)
#endif
#ifndef min
#define min(a, b) ((a < b) ? a : b)
#endif

View file

@ -59,7 +59,7 @@ int libmpq_archive_open(mpq_archive *mpq_a, unsigned char *mpq_filename) {
memset(mpq_a->header, 0, sizeof(mpq_header));
/* Check if file exists and is readable */
fd = _open((char *)mpq_filename, O_RDONLY | O_BINARY | O_LARGEFILE);
fd = _open((char *)mpq_filename, MPQ_FILE_OPEN_FLAGS);
if (fd == LIBMPQ_EFILE) {
return LIBMPQ_EFILE;
}