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

Add FMT_FORCE_FALLBACK_FILE to force the use of fallback_file #4009

Closed
wants to merge 1 commit into from

Conversation

Wraiyth
Copy link
Contributor

@Wraiyth Wraiyth commented Jun 10, 2024

Add a define to opt out of attempting to use the library/platform specific files, as mentioned in #3992

Specifically this helps work around an issue with apple_file is detected for use on some platforms (ie game consoles) but has buffered functionality that the platform may not support, which can cause crashes.

@vitaut
Copy link
Contributor

vitaut commented Jun 11, 2024

The doc CI failure is unrelated, please ignore.

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR>

@@ -1600,6 +1600,7 @@ template <typename F> class fallback_file : public file_base<F> {
}
};

#ifndef FMT_FORCE_FALLBACK_FILE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename to FMT_USE_FALLBACK_FILE for consistency with other similar macros and make it take value 0 or 1, see e.g.

fmt/include/fmt/base.h

Lines 158 to 164 in a5c1b5d

#ifdef FMT_USE_CONCEPTS
// Use the provided definition.
#elif defined(__cpp_concepts)
# define FMT_USE_CONCEPTS 1
#else
# define FMT_USE_CONCEPTS 0
#endif

@vitaut
Copy link
Contributor

vitaut commented Jun 22, 2024

Merged with minor tweaks in 2c0d9e9, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants