*** empty log message ***
[gnulib.git] / m4 / timespec.m4
1 #serial 1
2
3 dnl From Jim Meyering
4
5 dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared in time.h.
6
7 AC_DEFUN(jm_CHECK_TYPE_STRUCT_TIMESPEC,
8 [
9   AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
10     [AC_TRY_COMPILE(
11       [
12 #include <time.h>
13       ],
14       [static struct timespec x; x.tv_sec = x.tv_nsec;],
15       fu_cv_sys_struct_timespec=yes,
16       fu_cv_sys_struct_timespec=no)
17     ])
18
19   if test $fu_cv_sys_struct_timespec = yes; then
20     AC_DEFINE_UNQUOTED(HAVE_STRUCT_TIMESPEC, 1,
21                        [Define if struct timespec is declared in <time.h>. ])
22   fi
23 ])