Replace uses of _format with a macro.
_format is a user-defined literal which is removed from newer
releases of libfmt.
Bug: 271622675
Test: local build, presubmit
Change-Id: I60b2d6d157cb1ad1c16b4a4f681fad7be41cecb4
Merged-In: I2f5cc706ca8f734b1cad89e7d957fb7a52f78a10
diff --git a/libartbase/base/macros.h b/libartbase/base/macros.h
index 13e87d7..5f2100f 100644
--- a/libartbase/base/macros.h
+++ b/libartbase/base/macros.h
@@ -20,6 +20,7 @@
#include <stddef.h> // for size_t
#include <unistd.h> // for TEMP_FAILURE_RETRY
+#include "android-base/format.h"
#include "android-base/macros.h"
#include "android-base/thread_annotations.h"
@@ -32,6 +33,9 @@
#define ART_FRIEND_TYPED_TEST(test_set_name, individual_test)\
template<typename T> ART_FRIEND_TEST(test_set_name, individual_test)
+// Shorthand for formatting with compile time checking of the format string
+#define ART_FORMAT(str, ...) ::fmt::format(FMT_STRING(str), __VA_ARGS__)
+
// A macro to disallow new and delete operators for a class. It goes in the private: declarations.
// NOTE: Providing placement new (and matching delete) for constructing container elements.
#define DISALLOW_ALLOCATION() \