Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2010-07-26 14:41:26 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2010-07-26 14:41:26 +0400
commitbf1bee5d037a6ee731f57c4ec449d284386b0115 (patch)
tree6258bbbdc1523e66b18a4034fb3fd651303baece /source/blender/blenlib/intern/storage.c
parent8eb31b6bcb21bde6892da83f7e50e0d4430837d1 (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)
Diffstat (limited to 'source/blender/blenlib/intern/storage.c')
-rw-r--r--source/blender/blenlib/intern/storage.c13
1 files changed, 5 insertions, 8 deletions
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;