Skip to content

Commit

Permalink
Fix linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Automation committed Oct 18, 2024
1 parent b75d878 commit 7cc84d4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Sources/hylo-lsp-server/hylo-lsp-server-cli.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7cc84d4

Please sign in to comment.