From 7cc84d43886e221b89e455b55904ca111c751d52 Mon Sep 17 00:00:00 2001 From: GitHub Automation Date: Fri, 18 Oct 2024 12:58:53 +0200 Subject: [PATCH] Fix linux build --- Sources/hylo-lsp-server/hylo-lsp-server-cli.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Sources/hylo-lsp-server/hylo-lsp-server-cli.swift b/Sources/hylo-lsp-server/hylo-lsp-server-cli.swift index b7fe207..79ea473 100644 --- a/Sources/hylo-lsp-server/hylo-lsp-server-cli.swift +++ b/Sources/hylo-lsp-server/hylo-lsp-server-cli.swift @@ -98,8 +98,13 @@ struct HyloLspCommand: AsyncParsableCommand { #if !os(Windows) // Force line buffering - setvbuf(stdout, nil, _IOLBF, 0) - setvbuf(stderr, nil, _IOLBF, 0) + _ = withUnsafeMutablePointer(to: &stdout) { stdoutPointer in + setvbuf(stdoutPointer.pointee, nil, _IOLBF, 0) + } + + _ = withUnsafeMutablePointer(to: &stderr) { stderrPointer in + setvbuf(stderrPointer.pointee, nil, _IOLBF, 0) + } #endif let logFileURL = URL(fileURLWithPath: logFile)