[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60094] branches/soc-2013-depsgraph_mt/ source/creator/creator.c: Another windows compile fix for r.59942

Joshua Leung aligorith at gmail.com
Fri Sep 13 02:01:30 CEST 2013


Revision: 60094
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60094
Author:   aligorith
Date:     2013-09-13 00:01:29 +0000 (Fri, 13 Sep 2013)
Log Message:
-----------
Another windows compile fix for r.59942

Moved var declarations for unicode args array to start of main().

The fix used in the original commit won't work since the args
defined in that block won't be available for later steps.
However, they must be defined before the block of code used
to initialise the mem allocators

Modified Paths:
--------------
    branches/soc-2013-depsgraph_mt/source/creator/creator.c

Modified: branches/soc-2013-depsgraph_mt/source/creator/creator.c
===================================================================
--- branches/soc-2013-depsgraph_mt/source/creator/creator.c	2013-09-12 23:09:10 UTC (rev 60093)
+++ branches/soc-2013-depsgraph_mt/source/creator/creator.c	2013-09-13 00:01:29 UTC (rev 60094)
@@ -1466,6 +1466,13 @@
 	bArgs *ba;
 #endif
 
+#ifdef WIN32 /* Win32 Unicode Args */
+	wchar_t **argv_16;
+	int argci = 0;
+	char **argv;
+#endif
+
+
 	/* NOTE: Special excpetion for guarded allocator type switch:
 	 *       we need to perform switch from lock-free to fully
 	 *       guarded allocator before any allocation happened.
@@ -1488,16 +1495,13 @@
 
 	C = CTX_create();
 
-#ifdef WIN32
-	{
-		wchar_t **argv_16 = CommandLineToArgvW(GetCommandLineW(), &argc);
-		int argci = 0;
-		char **argv = MEM_mallocN(argc * sizeof(char *), "argv array");
-		for (argci = 0; argci < argc; argci++) {
-			argv[argci] = alloc_utf_8_from_16(argv_16[argci], 0);
-		}
-		LocalFree(argv_16);
+#ifdef WIN32 /* Win32 Unicode Args */
+	argv_16 = CommandLineToArgvW(GetCommandLineW(), &argc);
+	argv = MEM_mallocN(argc * sizeof(char *), "argv array");
+	for (argci = 0; argci < argc; argci++) {
+		argv[argci] = alloc_utf_8_from_16(argv_16[argci], 0);
 	}
+	LocalFree(argv_16);
 #endif
 
 #ifdef WITH_PYTHON_MODULE




More information about the Bf-blender-cvs mailing list