Revision: 39907
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39907
Author:   xiaoxiangquan
Date:     2011-09-04 14:32:32 +0000 (Sun, 04 Sep 2011)
Log Message:
-----------
use SetEnvironmentVariableA to set env var on windows

Modified Paths:
--------------
    branches/soc-2011-garlic/CMakeLists.txt
    branches/soc-2011-garlic/source/blender/blenlib/intern/path_util.c

Modified: branches/soc-2011-garlic/CMakeLists.txt
===================================================================
--- branches/soc-2011-garlic/CMakeLists.txt     2011-09-04 14:31:23 UTC (rev 
39906)
+++ branches/soc-2011-garlic/CMakeLists.txt     2011-09-04 14:32:32 UTC (rev 
39907)
@@ -565,6 +565,8 @@
                set(ICONV_INCLUDE_DIRS ${ICONV}/include)
                set(ICONV_LIBRARIES iconv)
                set(ICONV_LIBPATH ${ICONV}/lib)
+               set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MD")
+               set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MD")
        endif()
 
        if(WITH_SAMPLERATE)

Modified: branches/soc-2011-garlic/source/blender/blenlib/intern/path_util.c
===================================================================
--- branches/soc-2011-garlic/source/blender/blenlib/intern/path_util.c  
2011-09-04 14:31:23 UTC (rev 39906)
+++ branches/soc-2011-garlic/source/blender/blenlib/intern/path_util.c  
2011-09-04 14:32:32 UTC (rev 39907)
@@ -72,6 +72,7 @@
 #endif
 #define _WIN32_IE 0x0501
 #include <windows.h>
+#include <Winbase.h>
 #include <shlobj.h>
 
 #include "BLI_winstuff.h"
@@ -1157,14 +1158,13 @@
 {
        /* SGI or free windows */
 #if (defined(__sgi) || ((defined(WIN32) || defined(WIN64)) && 
defined(FREE_WINDOWS)))
-       char *envstr= MEM_mallocN(sizeof(char) * (strlen(env) + strlen(val) + 
2), "envstr"); /* one for = another for \0 */
-
-       sprintf(envstr, "%s=%s", env, val);
+       char *envstr= BLI_sprintfN("%s=%s", env, val);
        putenv(envstr);
        MEM_freeN(envstr);
 
        /* non-free windows */
 #elif (defined(WIN32) || defined(WIN64)) /* not free windows */
+       SetEnvironmentVariableA(env, val);
        _putenv_s(env, val);
 #else
        /* linux/osx/bsd */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to