From 516cdec4894096305f5002b922ba02d49cb3e816 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 2 Oct 2009 09:28:00 +0000 Subject: Optimised auto dependency generation Added control c handler in windows Now throw string exceptions instead of integer exceptions. --- tools/mhmake/src/fileinfo.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'tools/mhmake/src/fileinfo.h') diff --git a/tools/mhmake/src/fileinfo.h b/tools/mhmake/src/fileinfo.h index 227ba5e1f..a6606b294 100644 --- a/tools/mhmake/src/fileinfo.h +++ b/tools/mhmake/src/fileinfo.h @@ -49,6 +49,7 @@ extern bool g_CheckCircularDeps; extern bool g_ForceAutoDepRescan; extern bool g_PrintLexYacc; extern bool g_Clean; +extern bool g_StopCompiling; extern bool g_PrintMultipleDefinedRules; extern const string g_EmptyString; @@ -58,6 +59,14 @@ extern const string g_QuoteString; string QuoteFileName(const string &Filename); string UnquoteFileName(const string &Filename); +template +inline string stringify(const T& x) +{ + ostringstream o; + o << x; + return o.str(); +} + #define TIMESAFETY 3 class mh_time { @@ -196,7 +205,7 @@ public: string GetName() const; bool IsDir() const; - void DumpErrorMessageDuplicateRule(const refptr &pRule); + string GetErrorMessageDuplicateRule(const refptr &pRule); void SetRule(refptr &pRule) { @@ -222,12 +231,11 @@ public: { if (*m_pRule!=*pRule) { - DumpErrorMessageDuplicateRule(pRule); - throw(1); + throw(GetErrorMessageDuplicateRule(pRule)); } else if (g_PrintMultipleDefinedRules) { - DumpErrorMessageDuplicateRule(pRule); + cerr<