vendor/scs/src/ctrlc.c in scs-0.2.3 vs vendor/scs/src/ctrlc.c in scs-0.3.0

- old
+ new

@@ -20,13 +20,17 @@ static int istate; void scs_start_interrupt_listener(void) { istate = (int)utSetInterruptEnabled(true); } -void scs_end_interrupt_listener(void) { utSetInterruptEnabled((bool)istate); } +void scs_end_interrupt_listener(void) { + utSetInterruptEnabled((bool)istate); +} -int scs_is_interrupted(void) { return (int)utIsInterruptPending(); } +int scs_is_interrupted(void) { + return (int)utIsInterruptPending(); +} #elif (defined _WIN32 || _WIN64 || defined _WINDLL) #include <windows.h> static int int_detected; @@ -45,18 +49,22 @@ void scs_end_interrupt_listener(void) { SetConsoleCtrlHandler(scs_handle_ctrlc, FALSE); } -int scs_is_interrupted(void) { return int_detected; } +int scs_is_interrupted(void) { + return int_detected; +} #else /* Unix */ #include <signal.h> static int int_detected; struct sigaction oact; -static void scs_handle_ctrlc(int dummy) { int_detected = dummy ? dummy : -1; } +static void scs_handle_ctrlc(int dummy) { + int_detected = dummy ? dummy : -1; +} void scs_start_interrupt_listener(void) { struct sigaction act; int_detected = 0; act.sa_flags = 0; @@ -68,10 +76,12 @@ void scs_end_interrupt_listener(void) { struct sigaction act; sigaction(SIGINT, &oact, &act); } -int scs_is_interrupted(void) { return int_detected; } +int scs_is_interrupted(void) { + return int_detected; +} #endif /* END IF MATLAB_MEX_FILE / WIN32 */ #endif /* END IF CTRLC > 0 */