diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-02-21 11:43:13 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-02-21 11:43:13 +0300 |
commit | 7c7a931fed41dcf51e2d537a9157c357f0285955 (patch) | |
tree | 956105c8e2ab7f8553bccb963a1630d54dc3d2b0 /source/blender/blenlib | |
parent | 91d44a91249355827b6f135ab6e4fc52bfe926e4 (diff) |
made auto threads default (noob's get faster renders in their dual core CPU's)
changed env variable check order $TMP, $TMPDIR - aparently $TMP is more common.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/threads.c | 8 | ||||
-rw-r--r-- | source/blender/blenlib/intern/util.c | 21 |
2 files changed, 17 insertions, 12 deletions
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index f1b0dff491b..f4a44b3a0db 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -32,20 +32,20 @@ #include <stdlib.h> #include <string.h> #include <pthread.h> -#include <unistd.h> /* for checking system threads */ #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" #include "BLI_threads.h" +/* for checking system threads - BLI_system_thread_count */ #ifdef WIN32 #include "Windows.h" -#endif - -#ifdef __APPLE__ +#elif defined(__APPLE__) #include <sys/types.h> #include <sys/sysctl.h> +#else +#include <unistd.h> #endif /* ********** basic thread control API ************ diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index c3917178347..8480a9d6e06 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -1615,25 +1615,30 @@ void BLI_where_is_temp(char *fullname, int usertemp) strcpy(fullname, U.tempdir); } - if (fullname[0] == '\0') { + #ifdef WIN32 + if (fullname[0] == '\0') { char *tmp = getenv("TEMP"); /* Windows */ if (tmp && BLI_exists(tmp)) { strcpy(fullname, tmp); } + } #else - char *tmp = getenv("TMPDIR"); /* Other OS's - Try TMP and TMPDIR */ + /* Other OS's - Try TMP and TMPDIR */ + if (fullname[0] == '\0') { + char *tmp = getenv("TMP"); if (tmp && BLI_exists(tmp)) { strcpy(fullname, tmp); } - if (fullname[0] == '\0') { - tmp = getenv("TMP"); - if (tmp && BLI_exists(tmp)) { - strcpy(fullname, tmp); - } + } + + if (fullname[0] == '\0') { + char *tmp = getenv("TMPDIR"); + if (tmp && BLI_exists(tmp)) { + strcpy(fullname, tmp); } -#endif } +#endif if (fullname[0] == '\0') { strcpy(fullname, "/tmp/"); |