[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39907] branches/soc-2011-garlic: use SetEnvironmentVariableA to set env var on windows

xiao xiangquan xiaoxiangquan at gmail.com
Sun Sep 4 16:32:32 CEST 2011


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 */




More information about the Bf-blender-cvs mailing list