aboutsummaryrefslogtreecommitdiff
path: root/tools/mhmake/src/mhmake.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mhmake/src/mhmake.cpp')
-rw-r--r--tools/mhmake/src/mhmake.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/mhmake/src/mhmake.cpp b/tools/mhmake/src/mhmake.cpp
index 375621fb4..9f2699f91 100644
--- a/tools/mhmake/src/mhmake.cpp
+++ b/tools/mhmake/src/mhmake.cpp
@@ -25,6 +25,15 @@
#include "util.h"
bool g_Clean=false;
+bool g_StopCompiling=false;
+
+#ifdef WIN32
+BOOL WINAPI ControlCHandler(DWORD dwCtrlType)
+{
+ g_StopCompiling=true;
+ return TRUE;
+}
+#endif
int __CDECL main(int argc, char* argv[])
{
@@ -57,6 +66,9 @@ int __CDECL main(int argc, char* argv[])
* output to fail.
*/
putenv("VS_UNICODE_OUTPUT=");
+
+ SetConsoleCtrlHandler(ControlCHandler, TRUE);
+
#endif
try
@@ -120,9 +132,9 @@ int __CDECL main(int argc, char* argv[])
}
}
- catch (int Error)
+ catch (string Message)
{
- printf("Error occured %d\n",Error);
+ cerr << "Error occured: " << Message << endl;
#ifdef _DEBUG
if (g_DumpOnError)
{