File: check_steady_clock.m4

package info (click to toggle)
libfilezilla 0.54.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,504 kB
  • sloc: cpp: 31,105; sh: 4,241; makefile: 375; xml: 37
file content (25 lines) | stat: -rw-r--r-- 613 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
dnl Checks whether std::chrono::steady_clock is steady
dnl Unfortunately it is not always steady.

AC_DEFUN([CHECK_STEADY_CLOCK], [

  AC_LANG_PUSH(C++)

  AC_MSG_CHECKING([whether std::chrono::steady_clock is steady])

  AC_COMPILE_IFELSE([
    AC_LANG_PROGRAM([[
      #include <chrono>
    ]], [[
      static_assert(std::chrono::steady_clock::is_steady, "steady_clock isn't steady");
      return std::chrono::steady_clock::is_steady ? 0 : 1;
    ]])
  ], [
    AC_MSG_RESULT([yes])
  ], [
    AC_MSG_RESULT([no])
    AC_MSG_ERROR([a steady std::chrono::steady_clock is required])
  ])

  AC_LANG_POP(C++)
])