# config/c-compiler.m4
-# PGAC_C_SIGNED
-# -------------
-# Check if the C compiler understands signed types.
-AC_DEFUN([PGAC_C_SIGNED],
-[AC_CACHE_CHECK(for signed types, pgac_cv_c_signed,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
-[signed char c; signed short s; signed int i;])],
-[pgac_cv_c_signed=yes],
-[pgac_cv_c_signed=no])])
-if test x"$pgac_cv_c_signed" = xno ; then
- AC_DEFINE(signed,, [Define to empty if the C compiler does not understand signed types.])
-fi])# PGAC_C_SIGNED
-
-
-
# PGAC_C_PRINTF_ARCHETYPE
# -----------------------
# Select the format archetype to be used by gcc to check printf-type functions.
_ACEOF
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array members" >&5
-$as_echo_n "checking for flexible array members... " >&6; }
-if ${ac_cv_c_flexmember+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
- #include
- #include
- struct s { int n; double d[]; };
-int
-main ()
-{
-int m = getchar ();
- struct s *p = malloc (offsetof (struct s, d)
- + m * sizeof (double));
- p->d[0] = 0.0;
- return p->d != (double *) NULL;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_flexmember=yes
-else
- ac_cv_c_flexmember=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
-$as_echo "$ac_cv_c_flexmember" >&6; }
- if test $ac_cv_c_flexmember = yes; then
-
-$as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
-
- else
- $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
-
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed types" >&5
-$as_echo_n "checking for signed types... " >&6; }
-if ${pgac_cv_c_signed+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-signed char c; signed short s; signed int i;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv_c_signed=yes
-else
- pgac_cv_c_signed=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_signed" >&5
-$as_echo "$pgac_cv_c_signed" >&6; }
-if test x"$pgac_cv_c_signed" = xno ; then
-
-$as_echo "#define signed /**/" >>confdefs.h
-
-fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __func__" >&5
$as_echo_n "checking for __func__... " >&6; }
if ${pgac_cv_funcname_func_support+:} false; then :
AC_C_BIGENDIAN
AC_C_INLINE
PGAC_PRINTF_ARCHETYPE
-AC_C_FLEXIBLE_ARRAY_MEMBER
-PGAC_C_SIGNED
PGAC_C_FUNCNAME_SUPPORT
PGAC_C_STATIC_ASSERT
PGAC_C_TYPEOF
#define dummyret char
#endif
+/*
+ * We require C99, hence the compiler should understand flexible array
+ * members. However, for documentation purposes we still consider it to be
+ * project style to write "field[FLEXIBLE_ARRAY_MEMBER]" not just "field[]".
+ * When computing the size of such an object, use "offsetof(struct s, f)"
+ * for portability. Don't use "offsetof(struct s, f[0])", as this doesn't
+ * work with MSVC and with C++ compilers.
+ */
+#define FLEXIBLE_ARRAY_MEMBER /* empty */
+
/* Which __func__ symbol do we have, if any? */
#ifdef HAVE_FUNCNAME__FUNC
#define PG_FUNCNAME_MACRO __func__
(--enable-thread-safety) */
#undef ENABLE_THREAD_SAFETY
-/* Define to nothing if C supports flexible array members, and to 1 if it does
- not. That way, with a declaration like `struct s { int n; double
- d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99
- compilers. When computing the size of such an object, don't use 'sizeof
- (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)'
- instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with
- MSVC and with C++ compilers. */
-#undef FLEXIBLE_ARRAY_MEMBER
-
/* Define to 1 if gettimeofday() takes only 1 argument. */
#undef GETTIMEOFDAY_1ARG
# define __restrict__
#endif
-/* Define to empty if the C compiler does not understand signed types. */
-#undef signed
-
/* Define to how the compiler spells `typeof'. */
#undef typeof
ENABLE_GSS => $self->{options}->{gss} ? 1 : undef,
ENABLE_NLS => $self->{options}->{nls} ? 1 : undef,
ENABLE_THREAD_SAFETY => 1,
- FLEXIBLE_ARRAY_MEMBER => '/**/',
GETTIMEOFDAY_1ARG => undef,
HAVE_APPEND_HISTORY => undef,
HAVE_ASN1_STRING_GET0_DATA => undef,
pg_restrict => '__restrict',
# not defined, because it'd conflict with __declspec(restrict)
restrict => undef,
- signed => undef,
typeof => undef,);
if ($self->{options}->{uuid})