From e1a0401d25bcbc9191b585c2c8264db4fbbfe9e0 Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Sun, 2 Nov 2014 19:12:16 -0500 Subject: [PATCH] fixes guard macro for use of std::put_time std::put_time is in the c++11 iomanip header not chrono --- changelog.md | 4 ++++ websocketpp/logger/basic.hpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index c8978f224d..14d159c179 100644 --- a/changelog.md +++ b/changelog.md @@ -28,6 +28,10 @@ HEAD - Improvement: Core library no longer has std::iostream as a dependency. std::iostream is still required for the optional iostream logging policy and iostream transport. +- Bug: C++11 Chrono support was being incorrectly detected by the `boost_config` + header. Thank you Max Dmitrichenko for reporting and a patch. +- Bug: use of `std::put_time` is now guarded by a general 11 flag rather than + a chrono flag. Thank you Max Dmitrichenko for reporting. - Compatibility: Adjust usage of std::min to be more compatible with systems that define a min(...) macro. - Compatibility: Removes unused parameters from all library, test, and example diff --git a/websocketpp/logger/basic.hpp b/websocketpp/logger/basic.hpp index fc6b60e68b..07d3acc7ae 100644 --- a/websocketpp/logger/basic.hpp +++ b/websocketpp/logger/basic.hpp @@ -133,7 +133,7 @@ private: static std::ostream & timestamp(std::ostream & os) { std::time_t t = std::time(NULL); std::tm* lt = std::localtime(&t); - #ifdef _WEBSOCKETPP_CPP11_CHRONO_ + #ifdef _WEBSOCKETPP_CPP11_STL_ return os << std::put_time(lt,"%Y-%m-%d %H:%M:%S"); #else // Falls back to strftime, which requires a temporary copy of the string. char buffer[20];