diff --git a/src/client/client.cpp b/src/client/client.cpp index 5487fd61a7..f92a1f65b3 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -65,6 +65,10 @@ using ::boost::scoped_ptr; namespace lyx { +// Keep the linker happy on Windows +void emergencyCleanup() +{} + namespace support { string itoa(unsigned int i) diff --git a/src/support/os_cygwin.cpp b/src/support/os_cygwin.cpp index e0343f63db..bd84776e76 100644 --- a/src/support/os_cygwin.cpp +++ b/src/support/os_cygwin.cpp @@ -34,6 +34,9 @@ using namespace std; namespace lyx { + +void emergencyCleanup(); + namespace support { namespace os { @@ -129,9 +132,7 @@ BOOL terminate_handler(DWORD event) if (event == CTRL_CLOSE_EVENT || event == CTRL_LOGOFF_EVENT || event == CTRL_SHUTDOWN_EVENT) { - ::raise(SIGTERM); - // Relinquish our time slice. - sleep(0); + lyx::emergencyCleanup(); return TRUE; } return FALSE; diff --git a/src/support/os_win32.cpp b/src/support/os_win32.cpp index b450bf1100..f244ecbdd4 100644 --- a/src/support/os_win32.cpp +++ b/src/support/os_win32.cpp @@ -26,7 +26,6 @@ #include "support/lassert.h" -#include #include #include @@ -72,6 +71,9 @@ using namespace std; namespace lyx { + +void emergencyCleanup(); + namespace support { namespace os { @@ -86,9 +88,7 @@ BOOL terminate_handler(DWORD event) if (event == CTRL_CLOSE_EVENT || event == CTRL_LOGOFF_EVENT || event == CTRL_SHUTDOWN_EVENT) { - ::raise(SIGTERM); - // Relinquish our time slice. - Sleep(0); + lyx::emergencyCleanup(); return TRUE; } return FALSE; diff --git a/src/tex2lyx/tex2lyx.cpp b/src/tex2lyx/tex2lyx.cpp index c27f0c0886..d2aad9ed88 100644 --- a/src/tex2lyx/tex2lyx.cpp +++ b/src/tex2lyx/tex2lyx.cpp @@ -56,6 +56,11 @@ Messages & getGuiMessages() } +// Keep the linker happy on Windows +void emergencyCleanup() +{} + + string const trim(string const & a, char const * p) { // LASSERT(p, /**/);