diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2012-01-02 18:07:43 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2012-01-02 18:07:43 (GMT) |
commit | 131eed660716a2a8b52a6956f8e8a136425c404e (patch) | |
tree | 99ba06a0196fc4bc6e8eb84b1ff75fc984e89b92 /Source/cmSystemTools.h | |
parent | 40aedcbbaeddcb7e088c56e30f4252171e920baa (diff) | |
download | CMake-131eed660716a2a8b52a6956f8e8a136425c404e.zip CMake-131eed660716a2a8b52a6956f8e8a136425c404e.tar.gz CMake-131eed660716a2a8b52a6956f8e8a136425c404e.tar.bz2 |
cmake-gui: Improve interrupt granularity to fix bug 12649.
Instead of enabling interrupt only when a progress or message callback is called, add a new callback specifically for
interrupt. This new callback is called from GetFatalErrorOccured() so cmake-gui can immediately report interrupt status
instead of calling queuing a call to cmSystemTools::SetFatalErrorOccured() and waiting for the progress or message
callback to be called to process that queued call.
Diffstat (limited to 'Source/cmSystemTools.h')
-rw-r--r-- | Source/cmSystemTools.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 641c89f..02203a1 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -78,6 +78,11 @@ public: ///! Send a string to stderr. Stdout callbacks will not be invoced. static void Stderr(const char* s, int length); + + typedef bool (*InterruptCallback)(void*); + static void SetInterruptCallback(InterruptCallback f, void* clientData=0); + static bool GetInterruptFlag(); + ///! Return true if there was an error at any point. static bool GetErrorOccuredFlag() { @@ -96,7 +101,7 @@ public: ///! Return true if there was an error at any point. static bool GetFatalErrorOccured() { - return cmSystemTools::s_FatalErrorOccured; + return cmSystemTools::s_FatalErrorOccured || GetInterruptFlag(); } ///! Set the error occured flag and fatal error back to false @@ -467,8 +472,10 @@ private: static bool s_DisableRunCommandOutput; static ErrorCallback s_ErrorCallback; static StdoutCallback s_StdoutCallback; + static InterruptCallback s_InterruptCallback; static void* s_ErrorCallbackClientData; static void* s_StdoutCallbackClientData; + static void* s_InterruptCallbackClientData; static std::string s_Windows9xComspecSubstitute; }; |