Windows-specific handler
| 410 | #ifdef _WIN32 |
| 411 | // Windows-specific handler |
| 412 | BOOL WINAPI console_ctrl_handler(DWORD ctrl_type) { |
| 413 | if (ctrl_type == CTRL_C_EVENT) { |
| 414 | g_terminate_flag.store(true); |
| 415 | cout << "\nCtrl+C detected, cleaning up and closing the program..." << endl; |
| 416 | return TRUE; |
| 417 | } |
| 418 | return FALSE; |
| 419 | } |
| 420 | #else |
| 421 | // Unix/Linux/macOS handler |
| 422 | void signal_handler(int signal) { |