Blame m4/parse-datetime.m4

Packit Service a2489d
# parse-datetime.m4 serial 22
Packit Service a2489d
dnl Copyright (C) 2002-2006, 2008-2018 Free Software Foundation, Inc.
Packit Service a2489d
dnl This file is free software; the Free Software Foundation
Packit Service a2489d
dnl gives unlimited permission to copy and/or distribute it,
Packit Service a2489d
dnl with or without modifications, as long as this notice is preserved.
Packit Service a2489d
Packit Service a2489d
dnl Define HAVE_COMPOUND_LITERALS if the C compiler supports compound literals
Packit Service a2489d
dnl as in ISO C99.
Packit Service a2489d
dnl Note that compound literals such as (struct s) { 3, 4 } can be used for
Packit Service a2489d
dnl initialization of stack-allocated variables, but are not constant
Packit Service a2489d
dnl expressions and therefore cannot be used as initializer for global or
Packit Service a2489d
dnl static variables (even though gcc supports this in pre-C99 mode).
Packit Service a2489d
AC_DEFUN([gl_C_COMPOUND_LITERALS],
Packit Service a2489d
[
Packit Service a2489d
  AC_CACHE_CHECK([for compound literals], [gl_cv_compound_literals],
Packit Service a2489d
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[struct s { int i, j; };]],
Packit Service a2489d
      [[struct s t = (struct s) { 3, 4 };
Packit Service a2489d
        if (t.i != 0) return 0;]])],
Packit Service a2489d
    gl_cv_compound_literals=yes,
Packit Service a2489d
    gl_cv_compound_literals=no)])
Packit Service a2489d
  if test $gl_cv_compound_literals = yes; then
Packit Service a2489d
    AC_DEFINE([HAVE_COMPOUND_LITERALS], [1],
Packit Service a2489d
      [Define if you have compound literals.])
Packit Service a2489d
  fi
Packit Service a2489d
])
Packit Service a2489d
Packit Service a2489d
AC_DEFUN([gl_PARSE_DATETIME],
Packit Service a2489d
[
Packit Service a2489d
  dnl Prerequisites of lib/parse-datetime.h.
Packit Service a2489d
  AC_REQUIRE([AM_STDBOOL_H])
Packit Service a2489d
  AC_REQUIRE([gl_TIMESPEC])
Packit Service a2489d
Packit Service a2489d
  dnl Prerequisites of lib/parse-datetime.y.
Packit Service a2489d
  AC_REQUIRE([gl_BISON])
Packit Service a2489d
  AC_REQUIRE([gl_C_COMPOUND_LITERALS])
Packit Service a2489d
  AC_STRUCT_TIMEZONE
Packit Service a2489d
  AC_REQUIRE([gl_CLOCK_TIME])
Packit Service a2489d
  AC_REQUIRE([gl_TM_GMTOFF])
Packit Service a2489d
])