← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2302: always link with -mwindows but create / attach to the console in debug

 

------------------------------------------------------------
revno: 2302
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Tue 2010-11-23 17:38:12 +0100
message:
  always link with -mwindows but create / attach to the console in debug
modified:
  SConstruct
  dwt/src/Application.cpp
  win32/main.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'SConstruct'
--- SConstruct	2010-11-22 18:36:53 +0000
+++ SConstruct	2010-11-23 16:38:12 +0000
@@ -6,9 +6,9 @@
 from build_util import Dev, gen_po_name
 
 gcc_flags = {
-	'common': ['-g', '-Wall', '-Wextra', '-Wno-unused-parameter', '-Wno-unused-value', '-Wno-missing-field-initializers', '-Wno-address', '-fexceptions', '-mthreads'],
+	'common': ['-g', '-Wall', '-Wextra', '-Wno-unused-parameter', '-Wno-unused-value', '-Wno-missing-field-initializers', '-Wno-address', '-fexceptions', '-mthreads', '-mwindows'],
 	'debug': [], 
-	'release' : ['-O3', '-mwindows']
+	'release' : ['-O3']
 }
 
 gcc_xxflags = {
@@ -43,9 +43,9 @@
 }
 
 gcc_link_flags = {
-	'common' : ['-g', '-static-libgcc', '-static-libstdc++', '-Wl,--no-undefined', '-time', '-mthreads'],
+	'common' : ['-g', '-static-libgcc', '-static-libstdc++', '-Wl,--no-undefined', '-time', '-mthreads', '-mwindows'],
 	'debug' : [],
-	'release' : ['-mwindows']
+	'release' : []
 }
 
 msvc_link_flags = {

=== modified file 'dwt/src/Application.cpp'
--- dwt/src/Application.cpp	2010-02-14 16:55:56 +0000
+++ dwt/src/Application.cpp	2010-11-23 16:38:12 +0000
@@ -276,7 +276,7 @@
 
 } // namespace dwt
 
-int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
+int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
 {
 	unsigned int retVal = 0;
 

=== modified file 'win32/main.cpp'
--- win32/main.cpp	2010-08-30 02:20:49 +0000
+++ win32/main.cpp	2010-11-23 16:38:12 +0000
@@ -70,8 +70,6 @@
 #endif
 
 int SmartWinMain(dwt::Application& app) {
-	dcdebug("StartWinMain\n");
-
 	// http://www.kb.cert.org/vuls/id/707943 part III, "For Developers".
 	::SetDllDirectory(_T(""));
 
@@ -114,10 +112,10 @@
 #ifdef _DEBUG
 	old_handler = set_terminate(&term_handler);
 
-#ifdef __MINGW32__
-	// For debugging
-	::LoadLibrary(_T("exchndl.dll"));
-#endif
+	// attach to the parent console, or create one
+	if(!AttachConsole(ATTACH_PARENT_PROCESS))
+		AllocConsole();
+	freopen("conout$", "w", stdout);
 #endif
 
 	// For SHBrowseForFolder, UPnP_COM