Skip to content
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

[libc++] Make <print> work without deployment target requirement #75225

Closed
ldionne opened this issue Dec 12, 2023 · 0 comments · Fixed by #76293
Closed

[libc++] Make <print> work without deployment target requirement #75225

ldionne opened this issue Dec 12, 2023 · 0 comments · Fixed by #76293
Assignees
Labels
format C++20 std::format or std::print, and anything related to them libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@ldionne
Copy link
Member

ldionne commented Dec 12, 2023

In a follow-up, we could use _LIBCPP_AVAILABILITY_HAS_PRINT to check whether we have __get_ostream_file on the current deployment target. If we don't, we could instead assume that !__file and use __vprint_nonunicode. That would make this mostly work for older deployment targets, except for the flush below. But by and far, users could use <print> on older deployment targets with no issues.

We could then even remove the availability annotations on __vprint_unicode and others, since they would basically have no deployment target requirements anymore.

Originally posted by @ldionne in #73262 (comment)

@ldionne ldionne changed the title In a follow-up, we could use _LIBCPP_AVAILABILITY_HAS_PRINT to check whether we have __get_ostream_file on the current deployment target. If we don't, we could instead assume that !__file and use __vprint_nonunicode. That would make this *mostly* work for older deployment targets, except for the flush below. But by and far, users could use <print> on older deployment targets with no issues. [libc++] Make <print> work without deployment target requirement Dec 12, 2023
@ldionne ldionne added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Dec 12, 2023
@ldionne ldionne added format C++20 std::format or std::print, and anything related to them and removed new issue labels Dec 12, 2023
mordante added a commit to mordante/llvm-project that referenced this issue Dec 23, 2023
As suggested in llvm#73262 this enable the stream printing on Apple
backdeployment targets. This omits the check whether the file is a
terminal. This is not entirely conforming, but the differences should be
minor and are typically not observable.

Fixes llvm#75225
mordante added a commit that referenced this issue Jan 16, 2024
As suggested in #73262 this enable the stream printing on Apple
backdeployment targets. This omits the check whether the file is a
terminal. This is not entirely conforming, but the differences should be
minor and are typically not observable.

Fixes #75225
justinfargnoli pushed a commit to justinfargnoli/llvm-project that referenced this issue Jan 28, 2024
As suggested in llvm#73262 this enable the stream printing on Apple
backdeployment targets. This omits the check whether the file is a
terminal. This is not entirely conforming, but the differences should be
minor and are typically not observable.

Fixes llvm#75225
blueboxd pushed a commit to blueboxd/libcxx that referenced this issue Feb 1, 2024
As suggested in #73262 this enable the stream printing on Apple
backdeployment targets. This omits the check whether the file is a
terminal. This is not entirely conforming, but the differences should be
minor and are typically not observable.

Fixes llvm/llvm-project#75225

NOKEYCHECK=True
GitOrigin-RevId: 4a87db6b10a075849673247ded426504561a8a25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format C++20 std::format or std::print, and anything related to them libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants