diff --git a/contrib/extractor/System.cpp b/contrib/extractor/System.cpp index 9dffa0048..57dc16b22 100644 --- a/contrib/extractor/System.cpp +++ b/contrib/extractor/System.cpp @@ -16,7 +16,23 @@ #include "loadlib/adt.h" #include "loadlib/wdt.h" +#include +#if defined( __GNUC__ ) + #define _open open + #define _close close + #ifndef O_BINARY + #define O_BINARY 0 + #endif +#else + #include +#endif + +#ifdef O_LARGEFILE + #define OPEN_FLAGS (O_RDONLY | O_BINARY | O_LARGEFILE) +#else + #define OPEN_FLAGS (O_RDONLY | O_BINARY) +#endif extern ArchiveSet gOpenArchives; typedef struct @@ -81,9 +97,10 @@ void CreateDir( const std::string& Path ) bool FileExists( const char* FileName ) { - if(FILE* fp = fopen( FileName, "rb" )) + int fp = _open(FileName, OPEN_FLAGS); + if(fp != -1) { - fclose(fp); + _close(fp); return true; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f93f50e47..77ec91445 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7487" + #define REVISION_NR "7488" #endif // __REVISION_NR_H__