diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 0750e7fc..8d07cc67 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -1600,14 +1600,21 @@ template class fallback_file : public file_base { } }; -template +#ifndef FMT_USE_FALLBACK_FILE +# define FMT_USE_FALLBACK_FILE 1 +#endif + +template auto get_file(F* f, int) -> apple_file { return f; } -template +template inline auto get_file(F* f, int) -> glibc_file { return f; } + inline auto get_file(FILE* f, ...) -> fallback_file { return f; } using file_ref = decltype(get_file(static_cast(nullptr), 0)); diff --git a/test/scan.h b/test/scan.h index 15a80356..1f1cda74 100644 --- a/test/scan.h +++ b/test/scan.h @@ -153,11 +153,13 @@ class string_scan_buffer final : public scan_buffer { class file_scan_buffer final : public scan_buffer { private: - template + template static auto get_file(F* f, int) -> glibc_file { return f; } - template + template static auto get_file(F* f, int) -> apple_file { return f; }