Finalize master&new-lua-features merge

This commit is contained in:
Lion Kortlepel
2021-09-17 14:58:40 +02:00
parent 9dfe9f659a
commit 48caae25fd
13 changed files with 143 additions and 124 deletions

View File

@@ -6,18 +6,18 @@
static void UnixSignalHandler(int sig) {
switch (sig) {
case SIGPIPE:
warn("ignoring SIGPIPE");
beammp_warn("ignoring SIGPIPE");
break;
case SIGTERM:
info("gracefully shutting down via SIGTERM");
beammp_info("gracefully shutting down via SIGTERM");
Application::GracefullyShutdown();
break;
case SIGINT:
info("gracefully shutting down via SIGINT");
beammp_info("gracefully shutting down via SIGINT");
Application::GracefullyShutdown();
break;
default:
debug("unhandled signal: " + std::to_string(sig));
beammp_debug("unhandled signal: " + std::to_string(sig));
break;
}
}
@@ -29,15 +29,15 @@ static void UnixSignalHandler(int sig) {
BOOL WINAPI Win32CtrlC_Handler(DWORD CtrlType) {
switch (CtrlType) {
case CTRL_C_EVENT:
info("gracefully shutting down via CTRL+C");
beammp_info("gracefully shutting down via CTRL+C");
Application::GracefullyShutdown();
return TRUE;
case CTRL_BREAK_EVENT:
info("gracefully shutting down via CTRL+BREAK");
beammp_info("gracefully shutting down via CTRL+BREAK");
Application::GracefullyShutdown();
return TRUE;
case CTRL_CLOSE_EVENT:
info("gracefully shutting down via close");
beammp_info("gracefully shutting down via close");
Application::GracefullyShutdown();
return TRUE;
}
@@ -49,7 +49,7 @@ BOOL WINAPI Win32CtrlC_Handler(DWORD CtrlType) {
void SetupSignalHandlers() {
// signal handlers for unix#include <windows.h>
#ifdef __unix
trace("registering handlers for SIGINT, SIGTERM, SIGPIPE");
beammp_trace("registering handlers for SIGINT, SIGTERM, SIGPIPE");
signal(SIGPIPE, UnixSignalHandler);
signal(SIGTERM, UnixSignalHandler);
#ifndef DEBUG
@@ -59,7 +59,7 @@ void SetupSignalHandlers() {
// signal handlers for win32
#ifdef WIN32
trace("registering handlers for CTRL_*_EVENTs");
beammp_trace("registering handlers for CTRL_*_EVENTs");
SetConsoleCtrlHandler(Win32CtrlC_Handler, TRUE);
#endif // WIN32
}