Fix T40157: Loading movies larger than 4GB in size fails
Issue was caused by _wstat returning EOVERFLOW error because of file size didn't fit into stat structure which was using long datatype. The idea of this patch is to use _wstat64 and _stat64 structure which is capable storing 64bit file sizes. Made it a typedef for stat structure used by BLI_stat function in order to make code easier to follow and avoid ifdefs all over the place. Additionally solved issue with BLI_exists which was wrongly returning False in cases destination file is larger then 4GB.
This commit is contained in:
@@ -59,7 +59,18 @@ int BLI_rename(const char *from, const char *to);
|
||||
int BLI_delete(const char *path, bool dir, bool recursive);
|
||||
int BLI_move(const char *path, const char *to);
|
||||
int BLI_create_symlink(const char *path, const char *to);
|
||||
int BLI_stat(const char *path, struct stat *buffer);
|
||||
|
||||
#ifdef WIN32
|
||||
# ifndef __MINGW64__
|
||||
typedef struct _stat64 BLI_stat_t;
|
||||
# else
|
||||
typedef struct stat BLI_stat_t;
|
||||
#endif
|
||||
#else
|
||||
typedef struct stat BLI_stat_t;
|
||||
#endif
|
||||
|
||||
int BLI_stat(const char *path, BLI_stat_t *buffer);
|
||||
|
||||
/* Directories */
|
||||
|
||||
|
Reference in New Issue
Block a user