Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
8dcaa084
Commit
8dcaa084
authored
Sep 17, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace steady_clock with monotonic_clock if steady_clock is not available
parent
0a649e24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
configure.ac
configure.ac
+20
-0
src/nghttp2_config.h
src/nghttp2_config.h
+6
-0
No files found.
configure.ac
View file @
8dcaa084
...
...
@@ -80,6 +80,26 @@ AM_PATH_PYTHON([2.6],, [:])
AX_CXX_COMPILE_STDCXX_11([noext], [optional])
# Check that std::chrono::steady_clock is available. In particular,
# gcc 4.6 does not have one, but has monotonic_clock which is the old
# name existed in the pre-standard draft. If steady_clock is not
# available, don't define HAVE_STEADY_CLOCK and replace steady_clock
# with monotonic_clock.
AC_LANG_PUSH(C++)
AC_MSG_CHECKING([whether std::chrono::steady_clock is available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[
#include <chrono>
]],
[[
auto tp = std::chrono::steady_clock::now();
]])],
[AC_DEFINE([HAVE_STEADY_CLOCK], [1],
[Define to 1 if you have the `std::chrono::steady_clock`.])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
AC_LANG_POP()
# Checks for libraries.
# Additional libraries required for tests.
...
...
src/nghttp2_config.h
View file @
8dcaa084
...
...
@@ -29,4 +29,10 @@
# include <config.h>
#endif // HAVE_CONFIG_H
// gcc 4.6 has std::chrono::monotonic_clock, which was renamed as
// std::chrono::steady_clock in C++11 standard.
#ifndef HAVE_STEADY_CLOCK
# define steady_clock monotonic_clock
#endif // !HAVE_STEADY_CLOCK
#endif // NGHTTP2_CONFIG_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment