From: DannyDaemonic Date: Thu, 18 May 2023 17:30:40 +0000 (-0700) Subject: Fixes #1511 lambda issue for w64devkit (mingw) (#1513) X-Git-Tag: gguf-v0.4.0~746 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=ee9654138ab0ae5f138f4abddf56ca234ea3c352;p=pkg%2Fggml%2Fsources%2Fllama.cpp Fixes #1511 lambda issue for w64devkit (mingw) (#1513) * Fix for w64devkit and mingw --- diff --git a/examples/main/main.cpp b/examples/main/main.cpp index fe1c847a..18673ed2 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -241,7 +241,7 @@ int main(int argc, char ** argv) { sigint_action.sa_flags = 0; sigaction(SIGINT, &sigint_action, NULL); #elif defined (_WIN32) - auto console_ctrl_handler = [](DWORD ctrl_type) -> BOOL { + auto console_ctrl_handler = +[](DWORD ctrl_type) -> BOOL { return (ctrl_type == CTRL_C_EVENT) ? (sigint_handler(SIGINT), true) : false; }; SetConsoleCtrlHandler(static_cast(console_ctrl_handler), true);