[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33023] trunk/blender/source/blender: System console toggling for MinGW

Sergey Sharybin g.ulairi at gmail.com
Thu Nov 11 21:32:34 CET 2010


Revision: 33023
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33023
Author:   nazgul
Date:     2010-11-11 21:32:28 +0100 (Thu, 11 Nov 2010)

Log Message:
-----------
System console toggling for MinGW

Define WINVER=0x0501 for MinGW due to some stuff requres this winver, but
MinGW's default is 0x0400 (thanks AlexKu for point)

Better to replace all #include <windows.h> with #include "BLI_winstuff.h" to
avoid possibility of different functions prototypes in different modules.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_winstuff.h
    trunk/blender/source/blender/windowmanager/intern/wm_operators.c

Modified: trunk/blender/source/blender/blenlib/BLI_winstuff.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_winstuff.h	2010-11-11 19:28:10 UTC (rev 33022)
+++ trunk/blender/source/blender/blenlib/BLI_winstuff.h	2010-11-11 20:32:28 UTC (rev 33023)
@@ -36,8 +36,15 @@
 
 #ifndef FREE_WINDOWS
 #pragma warning(once: 4761 4305 4244 4018)
+#else
+#ifdef WINVER
+#undef WINVER
 #endif
 
+/* Some stuff requires WINVER 0x500, but mingw's default is 0x400 */
+#define WINVER 0x0501
+#endif
+
 #define WIN32_LEAN_AND_MEAN
 
 #ifndef WIN32_SKIP_HKEY_PROTECTION

Modified: trunk/blender/source/blender/windowmanager/intern/wm_operators.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_operators.c	2010-11-11 19:28:10 UTC (rev 33022)
+++ trunk/blender/source/blender/windowmanager/intern/wm_operators.c	2010-11-11 20:32:28 UTC (rev 33023)
@@ -32,8 +32,9 @@
 #include <stdio.h>
 #include <stddef.h>
 #include <assert.h>
+
 #ifdef WIN32
-#include <windows.h>
+#include "BLI_winstuff.h"
 #include <io.h>
 #endif
 
@@ -2036,7 +2037,7 @@
 }
 
 /* *********************** */
-#if defined(WIN32) && !defined(FREE_WINDOWS)
+#if defined(WIN32)
 static int console= 1;
 void WM_toggle_console(bContext *C, short show)
 {
@@ -3148,7 +3149,7 @@
 	WM_operatortype_append(WM_OT_splash);
 	WM_operatortype_append(WM_OT_search_menu);
 	WM_operatortype_append(WM_OT_call_menu);
-#if defined(WIN32) && !defined(FREE_WINDOWS)
+#if defined(WIN32)
 	WM_operatortype_append(WM_OT_toggle_console);
 #endif
 





More information about the Bf-blender-cvs mailing list