diff options
| author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-28 21:14:21 +0000 |
|---|---|---|
| committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-28 21:14:21 +0000 |
| commit | 60e2a4c859042d9e7b4aa24390cb0e60fad48cd6 (patch) | |
| tree | efbcc6b2e6fe77996e0a31224b32d82c414f1c4c /libstdc++-v3/src | |
| parent | 3c6d419718bbe307410cf2e03db130fa6dfc3556 (diff) | |
| download | ppe42-gcc-60e2a4c859042d9e7b4aa24390cb0e60fad48cd6.tar.gz ppe42-gcc-60e2a4c859042d9e7b4aa24390cb0e60fad48cd6.zip | |
* src/c++11/compatibility-chrono.cc (steady_clock::now()): If
!_GLIBCXX_USE_GETTIMEOFDAY perform conversion inline instead of
calling non-existent from_time_t.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199391 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/src')
| -rw-r--r-- | libstdc++-v3/src/c++11/compatibility-chrono.cc | 5 |
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 } |

