From: Shengjing Zhu <zhsj@debian.org>
Date: Tue, 15 Dec 2020 00:22:45 +0800
Subject: Backport api signature update in doc

---
 doc/api.rst        | 54 +++++++++++++++++++++++-------------------------------
 include/fmt/core.h |  6 +++++-
 2 files changed, 28 insertions(+), 32 deletions(-)

diff --git a/doc/api.rst b/doc/api.rst
index 9b6c0f3..48d6fd9 100644
--- a/doc/api.rst
+++ b/doc/api.rst
@@ -45,20 +45,20 @@ participate in an overload resolution if the latter is not a string.
 
 .. _format:
 
-.. doxygenfunction:: format(const S&, Args&&...)
-.. doxygenfunction:: vformat(const S&, basic_format_args<buffer_context<type_identity_t<Char>>>)
+.. doxygenfunction:: format(const S &format_str, Args&&... args)
+.. doxygenfunction:: vformat(const S &format_str, basic_format_args<buffer_context<type_identity_t<Char>>> args)
 
-.. doxygenfunction:: fmt::format_to(OutputIt, const S&, Args&&...)
-.. doxygenfunction:: fmt::format_to_n(OutputIt, size_t, const S&, const Args&...)
-.. doxygenfunction:: fmt::formatted_size(string_view, Args&&...)
+.. doxygenfunction:: format_to(OutputIt out, const S &format_str, Args&&... args)
+.. doxygenfunction:: format_to_n(OutputIt out, size_t n, const S&, const Args&... args)
+.. doxygenfunction:: formatted_size(string_view format_str, Args&&... args)
 
 .. _print:
 
-.. doxygenfunction:: print(const S&, Args&&...)
+.. doxygenfunction:: print(const S &format_str, Args&&... args)
 .. doxygenfunction:: vprint(string_view, format_args)
 
-.. doxygenfunction:: print(std::FILE *, const S&, Args&&...)
-.. doxygenfunction:: vprint(std::FILE *, string_view, format_args)
+.. doxygenfunction:: print(std::FILE *f, const S &format_str, Args&&... args)
+.. doxygenfunction:: vprint(std::FILE*, string_view, format_args)
 
 Named Arguments
 ---------------
@@ -280,22 +280,14 @@ conversion.
 .. doxygenclass:: fmt::basic_format_parse_context
    :members:
 
-Output Iterator Support
------------------------
-
-.. doxygenfunction:: fmt::format_to(OutputIt, const S&, Args&&...)
-.. doxygenfunction:: fmt::format_to_n(OutputIt, size_t, const S&, const Args&...)
-.. doxygenstruct:: fmt::format_to_n_result
-   :members:
-
 Literal-based API
 -----------------
 
 The following user-defined literals are defined in ``fmt/format.h``.
 
-.. doxygenfunction:: operator""_format(const char *, size_t)
+.. doxygenfunction:: operator""_format(const char *s, size_t n)
 
-.. doxygenfunction:: operator""_a(const char *, size_t)
+.. doxygenfunction:: operator""_a(const char *s, size_t)
 
 Utilities
 ---------
@@ -304,19 +296,19 @@ Utilities
 
 .. doxygentypedef:: fmt::char_t
 
-.. doxygenfunction:: fmt::ptr(const T *)
-.. doxygenfunction:: fmt::ptr(const std::unique_ptr<T>&)
-.. doxygenfunction:: fmt::ptr(const std::shared_ptr<T>&)
+.. doxygenfunction:: fmt::ptr(const T *p)
+.. doxygenfunction:: fmt::ptr(const std::unique_ptr<T> &p)
+.. doxygenfunction:: fmt::ptr(const std::shared_ptr<T> &p)
 
-.. doxygenfunction:: fmt::to_string(const T&)
+.. doxygenfunction:: fmt::to_string(const T &value)
 
-.. doxygenfunction:: fmt::to_wstring(const T&)
+.. doxygenfunction:: fmt::to_wstring(const T &value)
 
-.. doxygenfunction:: fmt::to_string_view(const Char *)
+.. doxygenfunction:: fmt::to_string_view(const Char *s)
 
-.. doxygenfunction:: fmt::join(Range&&, string_view)
+.. doxygenfunction:: fmt::join(Range &&range, string_view sep)
 
-.. doxygenfunction:: fmt::join(It, Sentinel, string_view)
+.. doxygenfunction:: fmt::join(It begin, Sentinel end, string_view sep)
 
 .. doxygenclass:: fmt::detail::buffer
    :members:
@@ -441,7 +433,7 @@ Terminal color and text style
 
 ``fmt/color.h`` provides support for terminal color and text style output.
 
-.. doxygenfunction:: print(const text_style&, const S&, const Args&...)
+.. doxygenfunction:: print(const text_style &ts, const S &format_str, const Args&... args)
 
 .. _ostream-api:
 
@@ -466,7 +458,7 @@ user-defined types that have overloaded ``operator<<``::
   std::string s = fmt::format("The date is {}", date(2012, 12, 9));
   // s == "The date is 2012-12-9"
 
-.. doxygenfunction:: print(std::basic_ostream<Char>&, const S&, Args&&...)
+.. doxygenfunction:: print(std::basic_ostream<Char> &os, const S &format_str, Args&&... args)
 
 .. _printf-api:
 
@@ -480,11 +472,11 @@ the POSIX extension for positional arguments. Unlike their standard
 counterparts, the ``fmt`` functions are type-safe and throw an exception if an
 argument type doesn't match its format specification.
 
-.. doxygenfunction:: printf(const S&, const Args&...)
+.. doxygenfunction:: printf(const S &format_str, const Args&... args)
 
-.. doxygenfunction:: fprintf(std::FILE *, const S&, const Args&...)
+.. doxygenfunction:: fprintf(std::FILE *f, const S &format, const Args&... args)
 
-.. doxygenfunction:: fprintf(std::basic_ostream<Char>&, const S&, const Args&...)
+.. doxygenfunction:: fprintf(std::basic_ostream<Char> &os, const S &format_str, const Args&... args)
 
 .. doxygenfunction:: sprintf(const S&, const Args&...)
 
diff --git a/include/fmt/core.h b/include/fmt/core.h
index 0a81e0c..f98b18a 100644
--- a/include/fmt/core.h
+++ b/include/fmt/core.h
@@ -274,7 +274,11 @@ struct monostate {};
 // An enable_if helper to be used in template parameters which results in much
 // shorter symbols: https://godbolt.org/z/sWw4vP. Extra parentheses are needed
 // to workaround a bug in MSVC 2019 (see #1140 and #1186).
-#define FMT_ENABLE_IF(...) enable_if_t<(__VA_ARGS__), int> = 0
+#ifdef FMT_DOC
+#  define FMT_ENABLE_IF(...)
+#else
+#  define FMT_ENABLE_IF(...) enable_if_t<(__VA_ARGS__), int> = 0
+#endif
 
 namespace detail {
 
