From 1dce91d78eb6764a474badee7559650502f1d2fc Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 12 Jun 2018 15:37:06 +0100 Subject: [PATCH] Reverted removal of #ifdef for chrono converters, and fixed in OC project a different way - seems the #ifdef was necessary after all, because of the difference in the way the cpp files are included in the full project vs the single include - in the OC project I moved the #include of catch_tostring.cpp first. That solves the project for now, but is a brittle solution --- include/internal/catch_tostring.cpp | 7 +++++-- projects/XCode/OCTest/catch_objc_impl.mm | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/internal/catch_tostring.cpp b/include/internal/catch_tostring.cpp index c0d90444..ee6a815f 100644 --- a/include/internal/catch_tostring.cpp +++ b/include/internal/catch_tostring.cpp @@ -12,6 +12,11 @@ # pragma clang diagnostic ignored "-Wglobal-constructors" #endif +// Enable specific decls locally +#if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER) +#define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER +#endif + #include "catch_tostring.h" #include "catch_interfaces_config.h" #include "catch_context.h" @@ -224,14 +229,12 @@ std::string StringMaker::convert(double value) { return fpToString(value, 10); } -#if defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER) std::string ratio_string::symbol() { return "a"; } std::string ratio_string::symbol() { return "f"; } std::string ratio_string::symbol() { return "p"; } std::string ratio_string::symbol() { return "n"; } std::string ratio_string::symbol() { return "u"; } std::string ratio_string::symbol() { return "m"; } -#endif // CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER } // end namespace Catch diff --git a/projects/XCode/OCTest/catch_objc_impl.mm b/projects/XCode/OCTest/catch_objc_impl.mm index 08622789..e439a3ab 100644 --- a/projects/XCode/OCTest/catch_objc_impl.mm +++ b/projects/XCode/OCTest/catch_objc_impl.mm @@ -1,6 +1,7 @@ // This file #includes all the .cpp files into a single .mm // - so they get compiled as ObjectiveC++ +#include "../../../include/internal/catch_tostring.cpp" #include "../../../include/internal/catch_approx.cpp" #include "../../../include/internal/catch_assertionhandler.cpp" #include "../../../include/internal/catch_assertionresult.cpp" @@ -52,7 +53,6 @@ #include "../../../include/internal/catch_test_spec.cpp" #include "../../../include/internal/catch_test_spec_parser.cpp" #include "../../../include/internal/catch_timer.cpp" -#include "../../../include/internal/catch_tostring.cpp" #include "../../../include/internal/catch_totals.cpp" #include "../../../include/internal/catch_uncaught_exceptions.cpp" #include "../../../include/internal/catch_version.cpp"