diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-07-26 14:41:26 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-07-26 14:41:26 +0400 |
commit | bf1bee5d037a6ee731f57c4ec449d284386b0115 (patch) | |
tree | 6258bbbdc1523e66b18a4034fb3fd651303baece | |
parent | 8eb31b6bcb21bde6892da83f7e50e0d4430837d1 (diff) |
[#22846] GCC 4.4.1 support in Windows
In this commit i've fixed crash when opening file browser. This crash was caused
by different _stat structures size in storage.c and filelist.c (because of force
setting __MSVCRT_VERSION__ in storage.c), other errors from report
were fixed earlier.
I've used _stati64 strcutrure and functions and tested on official
mingw-gcc 3.4.5, official mingw-gcc 4.4.0, tdm-mingw-gcc 4.4.1,
cross mingw-gcc 4.4.4 and cross mingw-gcc 4.2.1-sjlj -- everything was
ok in this configurations (except openexr and opencollada libraries which
requires sjlj compiler, so i was unable to build blender with that
libraries by official mingw-gcc 4.4.0)
-rw-r--r-- | source/blender/blenlib/BLI_storage_types.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/source/blender/blenlib/BLI_storage_types.h b/source/blender/blenlib/BLI_storage_types.h index f8ebc3938a1..bc3584db03e 100644 --- a/source/blender/blenlib/BLI_storage_types.h +++ b/source/blender/blenlib/BLI_storage_types.h @@ -58,6 +58,8 @@ struct direntry{ char *path; #if (defined(WIN32) || defined(WIN64)) && (_MSC_VER>=1500) struct _stat64 s; +#elif defined(__MINGW32__) + struct _stati64 s; #else struct stat s; #endif diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index f4679aa4dcf..edb6aecabb1 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -29,11 +29,6 @@ * Some really low-level file thingies. */ -/* needed for mingw & _stat64i32 */ -#ifdef FREE_WINDOWS -# define __MSVCRT_VERSION__ 0x0800 -#endif - #include <sys/types.h> #include <stdio.h> #include <stdlib.h> @@ -255,6 +250,8 @@ void BLI_builddir(char *dirname, char *relname) // Excluding other than current MSVC compiler until able to test. #if (defined(WIN32) || defined(WIN64)) && (_MSC_VER>=1500) _stat64(dlink->name,&files[actnum].s); +#elif defined(__MINGW32__) + _stati64(dlink->name,&files[actnum].s); #else stat(dlink->name,&files[actnum].s); #endif @@ -449,14 +446,14 @@ int BLI_exist(char *name) if (len > 3 && ( tmp[len-1]=='\\' || tmp[len-1]=='/') ) tmp[len-1] = '\0'; res = _stat(tmp, &st); if (res == -1) return(0); -#elif defined(WIN32) && defined(__MINGW32__) - struct stat st; +#elif defined(__MINGW32__) + struct _stati64 st; char tmp[FILE_MAXDIR+FILE_MAXFILE]; int len, res; BLI_strncpy(tmp, name, FILE_MAXDIR+FILE_MAXFILE); len = strlen(tmp); if (len > 3 && ( tmp[len-1]=='\\' || tmp[len-1]=='/') ) tmp[len-1] = '\0'; - res = stat(tmp, &st); + res = _stati64(tmp, &st); if (res) return(0); #else struct stat st; |