Skip to content

Commit 2dbcfad

Browse files
SquallATFlabath
authored andcommitted
[lldb-vscod] fix build with NDEBUG on windows
Summary: _setmode in assert will not run when build with NDEBUG Reviewers: mstorsjo, labath, amccarth Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69612
1 parent f1e0ae3 commit 2dbcfad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lldb/tools/lldb-vscode/VSCode.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ VSCode::VSCode()
4444
// Windows opens stdout and stdin in text mode which converts \n to 13,10
4545
// while the value is just 10 on Darwin/Linux. Setting the file mode to binary
4646
// fixes this.
47-
assert(_setmode(fileno(stdout), _O_BINARY));
48-
assert(_setmode(fileno(stdin), _O_BINARY));
47+
int result = _setmode(fileno(stdout), _O_BINARY);
48+
assert(result);
49+
result = _setmode(fileno(stdin), _O_BINARY);
50+
assert(result);
4951
#endif
5052
if (log_file_path)
5153
log.reset(new std::ofstream(log_file_path));
@@ -301,4 +303,3 @@ void VSCode::RunExitCommands() {
301303
}
302304

303305
} // namespace lldb_vscode
304-

0 commit comments

Comments
 (0)