From 7f24f7fd2361ff5d43775e4523bc78ffdb108306 Mon Sep 17 00:00:00 2001 From: Dwayne Boone Date: Wed, 19 Nov 2008 11:06:31 -0330 Subject: Added use of CtrlChandler to slice compilers --- cpp/src/Slice/Preprocessor.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cpp/src/Slice/Preprocessor.cpp') diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp index 8c7f1983413..1d331f24387 100644 --- a/cpp/src/Slice/Preprocessor.cpp +++ b/cpp/src/Slice/Preprocessor.cpp @@ -28,6 +28,19 @@ using namespace std; using namespace Slice; +// +// Callback for Crtl-C signal handling +// +static Preprocessor* _preprocess = 0; + +static void closeCallback() +{ + if(_preprocess != 0) + { + _preprocess->close(); + } +} + // // mcpp defines // @@ -51,6 +64,8 @@ Slice::Preprocessor::Preprocessor(const string& path, const string& fileName, co _args(args), _cppHandle(0) { + _preprocess = this; + SignalHandler::setCloseCallback(closeCallback); } Slice::Preprocessor::~Preprocessor() @@ -437,6 +452,9 @@ Slice::Preprocessor::printMakefileDependencies(Language lang, const vector