Blame m4/parse-datetime.m4

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