Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2018-06-12 15:37:06 +0100
committerPhil Nash2018-06-12 15:37:06 +0100
commit1dce91d78eb6764a474badee7559650502f1d2fc (patch)
tree163cb9825fb676abab920d838950d8e8a6710825 /include
parentb8553d62a3a98ac9d358d20b48cf99f775291557 (diff)
downloadcatch3-1dce91d78eb6764a474badee7559650502f1d2fc.tar.gz
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
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_tostring.cpp7
1 files changed, 5 insertions, 2 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<double>::convert(double value) {
return fpToString(value, 10);
}
-#if defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
std::string ratio_string<std::atto>::symbol() { return "a"; }
std::string ratio_string<std::femto>::symbol() { return "f"; }
std::string ratio_string<std::pico>::symbol() { return "p"; }
std::string ratio_string<std::nano>::symbol() { return "n"; }
std::string ratio_string<std::micro>::symbol() { return "u"; }
std::string ratio_string<std::milli>::symbol() { return "m"; }
-#endif // CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
} // end namespace Catch