File: check_steady_clock.m4

package info (click to toggle)
filezilla 3.69.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,768 kB
  • sloc: cpp: 97,621; ansic: 54,984; sh: 5,225; makefile: 2,080; xml: 375
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++)
])