aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-01-23 02:59:13 +0000
committerGravatar Sadie Powell2023-01-23 13:07:52 +0000
commit671b84ecf2a86ee66e889e3931823bd6224d1dea (patch)
treea4d13dc93481b4598610931881f4ce50de2abfdc /include
parentDefault more stuff inline in the InspIRCd class. (diff)
Vendor the fmtlib library.
Diffstat (limited to 'include')
-rw-r--r--include/inspstring.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/inspstring.h b/include/inspstring.h
index 7a43c6531..4ccba2a9e 100644
--- a/include/inspstring.h
+++ b/include/inspstring.h
@@ -38,6 +38,17 @@
va_end(_vaList); \
} while (false)
+/** @def INSP_FORMAT(FORMAT, ...)
+ * Formats a string with format string checking.
+ */
+#if defined __cpp_if_constexpr && defined __cpp_return_type_deduction
+# include <fmt/compile.h>
+# define INSP_FORMAT(FORMAT, ...) fmt::format(FMT_COMPILE(FORMAT), __VA_ARGS__)
+#else
+# include <fmt/core.h>
+# define INSP_FORMAT(FORMAT, ...) fmt::format(FMT_STRING(FORMAT), __VA_ARGS__)
+#endif
+
namespace Base64
{
/** The default table used when handling Base64-encoded strings. */