signal_windows
1、Qt532(vs2010 opengl)
// ZC: windows signal: // http://blog.csdn.net/mergerly/article/details/7952118 // https://msdn.microsoft.com/zh-cn/library/xdkz3x12.aspx typedef void (*SignalHandlerPointer)(int); void SignalHandler(int _signal) { printf("Application aborting...\n"); } void MainWindow::on_pushButton_clicked() { SignalHandlerPointer previousHandler; previousHandler = signal(SIGABRT, SignalHandler); // ZC: 自己指定SIGABRT信号的 处理函数 // STDOUT_FILENO 为 类unix专有概念,我这里用 标准输出来代替 /* SIGABRT SIG_DFL sig_atomic_t signal() //*/ }
2、
3、
//ZC:windowssignal:
//http://blog.csdn.net/mergerly/article/details/7952118
//https://msdn.microsoft.com/zh-cn/library/xdkz3x12.aspx
typedefvoid(*SignalHandlerPointer)(int);
voidSignalHandler(int_signal)
{
printf("Applicationaborting...\n");
}
voidMainWindow::on_pushButton_clicked()
{
SignalHandlerPointerpreviousHandler;
previousHandler=signal(SIGABRT,SignalHandler);//ZC:自己指定SIGABRT信号的处理函数
//STDOUT_FILENO为类unix专有概念,我这里用标准输出来代替
/*SIGABRT
SIG_DFL
sig_atomic_t
signal()
//*/
}