mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-13 03:22:40 -04:00
* Fixed extractor on systems with 2GB fopen() limit. Author: arrai
--HG-- branch : trunk
This commit is contained in:
@@ -16,6 +16,23 @@
|
||||
|
||||
#include "loadlib/adt.h"
|
||||
#include "loadlib/wdt.h"
|
||||
#include <fcntl.h>
|
||||
|
||||
#if defined( __GNUC__ )
|
||||
#define _open open
|
||||
#define _close close
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
#else
|
||||
#include <io.h>
|
||||
#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;
|
||||
|
||||
@@ -81,9 +98,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user