Skip to content

[libc++] Guard the whole print.cpp file with _LIBCPP_WIN32API #71122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions libcxx/src/print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
//===----------------------------------------------------------------------===//

#include <__config>
#include <cstdlib>
#include <print>

#if defined(_LIBCPP_WIN32API)

# include <cstdlib>
# include <print>

# define WIN32_LEAN_AND_MEAN
# define NOMINMAX
# include <io.h>
Expand All @@ -19,11 +21,9 @@
# include <__system_error/system_error.h>

# include "filesystem/error.h"
#endif

_LIBCPP_BEGIN_NAMESPACE_STD

#ifdef _WIN32
_LIBCPP_EXPORTED_FROM_ABI bool __is_windows_terminal(FILE* __stream) {
// Note the Standard does this in one call, but it's unclear whether
// an invalid handle is allowed when calling GetConsoleMode.
Expand Down Expand Up @@ -52,6 +52,6 @@ __write_to_windows_console([[maybe_unused]] FILE* __stream, [[maybe_unused]] wst
}
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS

#endif // _WIN32

_LIBCPP_END_NAMESPACE_STD

#endif // !_LIBCPP_WIN32API