mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 23:34:06 +00:00
Merge pull request #2 from csg2008/branch-qt-5.15
Enhance the function to check whether the file exists, support large files
This commit is contained in:
commit
9437025179
8
file.cc
8
file.cc
|
@ -68,10 +68,18 @@ void loadFromFile( std::string const & n, std::vector< char > & data )
|
|||
bool exists( char const * filename ) throw()
|
||||
{
|
||||
#ifdef __WIN32
|
||||
#if defined(__WIN64) || defined(_MSC_VER)
|
||||
struct _stat64 buf;
|
||||
#else
|
||||
struct _stat buf;
|
||||
#endif
|
||||
wchar_t wname[16384];
|
||||
MultiByteToWideChar( CP_UTF8, 0, filename, -1, wname, 16384 );
|
||||
#if defined(__WIN64) || defined(_MSC_VER)
|
||||
return _wstat64( wname, &buf ) == 0;
|
||||
#else
|
||||
return _wstat( wname, &buf ) == 0;
|
||||
#endif
|
||||
#else
|
||||
struct stat buf;
|
||||
|
||||
|
|
Loading…
Reference in a new issue