From 59dc29e7012610ed5aec65d2921e7ec6754f5c70 Mon Sep 17 00:00:00 2001 From: Ryan Blue Date: Sun, 11 Aug 2024 02:23:25 -0400 Subject: [PATCH] [units] Add default case for UNIT_ADD_IO (#6944) --- wpimath/src/main/native/include/units/base.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wpimath/src/main/native/include/units/base.h b/wpimath/src/main/native/include/units/base.h index 972f3feb47..006c52c09e 100644 --- a/wpimath/src/main/native/include/units/base.h +++ b/wpimath/src/main/native/include/units/base.h @@ -175,7 +175,7 @@ namespace units * @param namespaceName namespace in which the new units will be encapsulated. * @param nameSingular singular version of the unit name, e.g. 'meter' * @param abbrev - abbreviated unit name, e.g. 'm' - * @note When UNIT_LIB_ENABLE_IOSTREAM isn't defined, the macro does not generate any code + * @note When UNIT_LIB_DISABLE_FMT is defined and UNIT_LIB_ENABLE_IOSTREAM isn't defined, the macro does not generate any code */ #if __has_include() && !defined(UNIT_LIB_DISABLE_FMT) #define UNIT_ADD_IO(namespaceName, nameSingular, abbrev)\ @@ -203,8 +203,7 @@ namespace units return units::detail::to_string(obj()) + std::string(" "#abbrev);\ }\ } -#endif -#if defined(UNIT_LIB_ENABLE_IOSTREAM) +#elif defined(UNIT_LIB_ENABLE_IOSTREAM) #define UNIT_ADD_IO(namespaceName, nameSingular, abbrev)\ namespace namespaceName\ {\ @@ -217,6 +216,8 @@ namespace units return units::detail::to_string(obj()) + std::string(" "#abbrev);\ }\ } +#else + #define UNIT_ADD_IO(namespaceName, nameSingular, abbrev) #endif /**