summaryrefslogtreecommitdiff
path: root/libstdc++-v3/src
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely.gcc@gmail.com>2013-05-28 21:14:21 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2013-05-28 22:14:21 +0100
commit8b70770dc804942b65b4526491af69ecc69b795d (patch)
treeefbcc6b2e6fe77996e0a31224b32d82c414f1c4c /libstdc++-v3/src
parent36536d79af79b5a252356e79e62b851f3f2bedf9 (diff)
downloadgcc-8b70770dc804942b65b4526491af69ecc69b795d.tar.gz
compatibility-chrono.cc (steady_clock::now()): If !_GLIBCXX_USE_GETTIMEOFDAY perform conversion inline instead of calling...
* src/c++11/compatibility-chrono.cc (steady_clock::now()): If !_GLIBCXX_USE_GETTIMEOFDAY perform conversion inline instead of calling non-existent from_time_t. From-SVN: r199391
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r--libstdc++-v3/src/c++11/compatibility-chrono.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/libstdc++-v3/src/c++11/compatibility-chrono.cc b/libstdc++-v3/src/c++11/compatibility-chrono.cc
index fd67daec4c5..efc32f5ff95 100644
--- a/libstdc++-v3/src/c++11/compatibility-chrono.cc
+++ b/libstdc++-v3/src/c++11/compatibility-chrono.cc
@@ -78,7 +78,10 @@ namespace std _GLIBCXX_VISIBILITY(default)
+ chrono::microseconds(tv.tv_usec)));
#else
std::time_t __sec = std::time(0);
- return system_clock::from_time_t(__sec);
+ // This is the conversion done by system_clock::from_time_t(__sec)
+ typedef chrono::time_point<system_clock, seconds> __from;
+ return time_point_cast<system_clock::duration>
+ (__from(chrono::seconds(__sec)));
#endif
}