[upstream_utils] Upgrade to fmt 11.1.0 (#7593)

Usage of FMT_STRING() was removed since it caused compilation failures,
and https://fmt.dev/11.1/api/#compile-time-checks says it's no longer
necessary for compile-time format strings.

Fixes #7592.
This commit is contained in:
Tyler Veness
2024-12-26 17:14:02 -08:00
committed by GitHub
parent 72fdca3507
commit 0470e51569
22 changed files with 3765 additions and 4239 deletions

View File

@@ -134,12 +134,12 @@ namespace warn {
* @param[out] status error code
* @param[in] format error message format
*/
#define FRC_ReportError(status, format, ...) \
do { \
if ((status) != 0) { \
::frc::ReportError(status, __FILE__, __LINE__, __FUNCTION__, \
FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__); \
} \
#define FRC_ReportError(status, format, ...) \
do { \
if ((status) != 0) { \
::frc::ReportError(status, __FILE__, __LINE__, __FUNCTION__, \
format __VA_OPT__(, ) __VA_ARGS__); \
} \
} while (0)
/**
@@ -150,7 +150,7 @@ namespace warn {
#define FRC_ReportWarning(format, ...) \
do { \
::frc::ReportError(warn::Warning, __FILE__, __LINE__, __FUNCTION__, \
FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__); \
format __VA_OPT__(, ) __VA_ARGS__); \
} while (0)
/**
@@ -163,7 +163,7 @@ namespace warn {
*/
#define FRC_MakeError(status, format, ...) \
::frc::MakeError(status, __FILE__, __LINE__, __FUNCTION__, \
FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__)
format __VA_OPT__(, ) __VA_ARGS__)
/**
* Checks a status code and depending on its value, either throws a
@@ -172,24 +172,23 @@ namespace warn {
* @param[out] status error code
* @param[in] format error message format
*/
#define FRC_CheckErrorStatus(status, format, ...) \
do { \
if ((status) < 0) { \
throw ::frc::MakeError(status, __FILE__, __LINE__, __FUNCTION__, \
FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__); \
} else if ((status) > 0) { \
::frc::ReportError(status, __FILE__, __LINE__, __FUNCTION__, \
FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__); \
} \
#define FRC_CheckErrorStatus(status, format, ...) \
do { \
if ((status) < 0) { \
throw ::frc::MakeError(status, __FILE__, __LINE__, __FUNCTION__, \
format __VA_OPT__(, ) __VA_ARGS__); \
} else if ((status) > 0) { \
::frc::ReportError(status, __FILE__, __LINE__, __FUNCTION__, \
format __VA_OPT__(, ) __VA_ARGS__); \
} \
} while (0)
#define FRC_AssertMessage(condition, format, ...) \
do { \
if (!(condition)) { \
throw ::frc::MakeError(err::AssertionFailure, __FILE__, __LINE__, \
__FUNCTION__, \
FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__); \
} \
#define FRC_AssertMessage(condition, format, ...) \
do { \
if (!(condition)) { \
throw ::frc::MakeError(err::AssertionFailure, __FILE__, __LINE__, \
__FUNCTION__, format __VA_OPT__(, ) __VA_ARGS__); \
} \
} while (0)
#define FRC_Assert(condition) FRC_AssertMessage(condition, #condition)