diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-05-28 18:48:59 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-05-28 18:48:59 +0300 |
commit | 8ead56c4c974ea3f7481be61c74a0bbd5b8cde83 (patch) | |
tree | 80a55f0ac146c8379a14397649c6d57623f5cf50 /source/blender/blenlib/intern | |
parent | 6dfe56f01a2bac39e848316bcfa6882318768c3b (diff) | |
parent | b947810291b16d3f304e2cd59f94c96c5f6e6f51 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 5 | ||||
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 14 | ||||
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 36 | ||||
-rw-r--r-- | source/blender/blenlib/intern/winstuff.c | 2 |
4 files changed, 14 insertions, 43 deletions
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index db4b3bcf20c..1df7f6f81e4 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -42,9 +42,6 @@ #include "zlib.h" #ifdef WIN32 -# ifdef __MINGW32__ -# include <ctype.h> -# endif # include <io.h> # include "BLI_winstuff.h" # include "BLI_callbacks.h" @@ -265,7 +262,7 @@ void *BLI_gzopen(const char *filename, const char *mode) /* temporary #if until we update all libraries to 1.2.7 * for correct wide char path handling */ -#if ZLIB_VERNUM >= 0x1270 && !defined(FREE_WINDOWS) +#if ZLIB_VERNUM >= 0x1270 UTF16_ENCODE(filename); gzfile = gzopen_w(filename_16, mode); diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 40b6aaa18c1..4b3a74d02ae 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1173,22 +1173,10 @@ bool BLI_path_program_search( void BLI_setenv(const char *env, const char *val) { /* free windows */ -#if (defined(WIN32) || defined(WIN64)) && defined(FREE_WINDOWS) - char *envstr; - if (val) - envstr = BLI_sprintfN("%s=%s", env, val); - else - envstr = BLI_sprintfN("%s=", env); - - putenv(envstr); - MEM_freeN(envstr); - - /* non-free windows */ -#elif (defined(WIN32) || defined(WIN64)) /* not free windows */ +#if (defined(WIN32) || defined(WIN64)) uputenv(env, val); - #else /* linux/osx/bsd */ if (val) diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 3edc00a8c1a..48280c14d7d 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -113,7 +113,7 @@ double BLI_dir_free_space(const char *dir) #ifdef WIN32 DWORD sectorspc, bytesps, freec, clusters; char tmp[4]; - + tmp[0] = '\\'; tmp[1] = 0; /* Just a failsafe */ if (dir[0] == '/' || dir[0] == '\\') { tmp[0] = '\\'; @@ -139,10 +139,10 @@ double BLI_dir_free_space(const char *dir) char name[FILE_MAXDIR], *slash; int len = strlen(dir); - + if (len >= FILE_MAXDIR) /* path too long */ return -1; - + strcpy(name, dir); if (len) { @@ -194,7 +194,7 @@ size_t BLI_file_size(const char *path) */ int BLI_exists(const char *name) { -#if defined(WIN32) +#if defined(WIN32) BLI_stat_t st; wchar_t *tmp_16 = alloc_utf16_from_8(name, 1); int len, res; @@ -253,10 +253,8 @@ int BLI_stat(const char *path, BLI_stat_t *buffer) int BLI_wstat(const wchar_t *path, BLI_stat_t *buffer) { -#if defined(_MSC_VER) || defined(__MINGW64__) +#if defined(_MSC_VER) return _wstat64(path, buffer); -#elif defined(__MINGW32__) - return _wstati64(path, buffer); #else return _wstat(path, buffer); #endif @@ -372,7 +370,7 @@ LinkNode *BLI_file_read_as_lines(const char *name) size_t size; if (!fp) return NULL; - + fseek(fp, 0, SEEK_END); size = (size_t)ftell(fp); fseek(fp, 0, SEEK_SET); @@ -385,7 +383,7 @@ LinkNode *BLI_file_read_as_lines(const char *name) buf = MEM_mallocN(size, "file_as_lines"); if (buf) { size_t i, last = 0; - + /* * size = because on win32 reading * all the bytes in the file will return @@ -403,10 +401,10 @@ LinkNode *BLI_file_read_as_lines(const char *name) last = i + 1; } } - + MEM_freeN(buf); } - + fclose(fp); return lines.list; @@ -424,23 +422,13 @@ 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 + struct _stat st1, st2; 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 + if (_wstat(file1_16, &st1)) return false; + if (_wstat(file2_16, &st2)) return false; UTF16_UN_ENCODE(file2); UTF16_UN_ENCODE(file1); diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index 3b06b7df09a..d6834428376 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -160,8 +160,6 @@ void RegisterBlendExtension(void) GetSystemDirectory(SysDir, FILE_MAXDIR); #ifdef _WIN64 ThumbHandlerDLL = "BlendThumb64.dll"; -#elif defined(__MINGW32__) - ThumbHandlerDLL = "BlendThumb.dll"; #else IsWow64Process(GetCurrentProcess(), &IsWOW64); if (IsWOW64 == true) |