diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-04-17 23:35:33 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-04-17 23:35:33 +0400 |
commit | 3fcb75f0b9bdb52d121e9cc7e91468f7ff382848 (patch) | |
tree | 911b3862c777f46e56f96b14505792588fbd4dc3 /source/blender/blenlib/intern/storage.c | |
parent | 2cf167cd21dae8403bcd628106d376faeb919b30 (diff) |
Fix thumbnails not appearing on MinGW64, was actually a mistake on
MinGW-w64 headers (where _stat is actually _stati64), but since we
recommend a specific compiler build it's OK for now. Also tweaked other
places where _wstat is used.
Diffstat (limited to 'source/blender/blenlib/intern/storage.c')
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index e5c0d91fd29..841207b2ed4 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -525,7 +525,14 @@ int BLI_stat(const char *path, struct stat *buffer) { int r; UTF16_ENCODE(path); + + /* workaround error in MinGW64 headers, normally, a wstat should work */ + #ifndef __MINGW64__ r = _wstat(path_16, buffer); + #else + r = _wstati64(path_16, buffer); + #endif + UTF16_UN_ENCODE(path); return r; } @@ -614,13 +621,23 @@ void BLI_file_free_lines(LinkNode *lines) bool BLI_file_older(const char *file1, const char *file2) { #ifdef WIN32 + #ifndef __MINGW32__ struct _stat st1, st2; + #else + struct _stati64 st1, st2; + #endif UTF16_ENCODE(file1); UTF16_ENCODE(file2); + #ifndef __MINGW32__ if (_wstat(file1_16, &st1)) return false; if (_wstat(file2_16, &st2)) return false; + #else + if (_wstati64(file1_16, &st1)) return false; + if (_wstati64(file2_16, &st2)) return false; + #endif + UTF16_UN_ENCODE(file2); UTF16_UN_ENCODE(file1); |