-#line 6521 "configure"
+#line 6748 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
XOpenDisplay()
; return 0; }
EOF
-if { (eval echo configure:6532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
PWD_INCDIR=no
ac_safe=`echo "pwd.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pwd.h""... $ac_c" 1>&6
-echo "configure:6579: checking for pwd.h" >&5
+echo "configure:6806: checking for pwd.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
-#line 6584 "configure"
+#line 6811 "configure"
#include "confdefs.h"
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT)
+dnl Determine memory alignment requirements for the basic C datatypes.
+
+dnl CHECK_ALIGNOF(TYPE)
+dnl This is modeled on the standard autoconf macro AC_CHECK_SIZEOF,
+dnl except it finds the alignment requirement of the type instead of the size.
+dnl The defined symbol is named ALIGNOF_TYPE, where the type name is
+dnl converted in the same way as for AC_CHECK_SIZEOF.
+dnl If cross-compiling, sizeof(type) is used as a default assumption.
+
+AC_DEFUN(CHECK_ALIGNOF,
+[changequote(<<, >>)dnl
+dnl The name to #define.
+define(<
>, translit(alignof_$1, [a-z *], [A-Z_P]))dnl
+dnl The cache variable name.
+define(<
>, translit(ac_cv_alignof_$1, [ *], [_p]))dnl
+changequote([, ])dnl
+AC_MSG_CHECKING(alignment of $1)
+AC_CACHE_VAL(AC_CV_NAME,
+[AC_TRY_RUN([#include
+struct { char filler; $1 field; } mystruct;
+main()
+{
+ FILE *f=fopen("conftestval", "w");
+ if (!f) exit(1);
+ fprintf(f, "%d\n", ((char*) & mystruct.field) - ((char*) & mystruct));
+ exit(0);
+}], AC_CV_NAME=`cat conftestval`,
+AC_CV_NAME='sizeof($1)',
+AC_CV_NAME='sizeof($1)')])dnl
+AC_MSG_RESULT($AC_CV_NAME)
+AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
+undefine([AC_TYPE_NAME])dnl
+undefine([AC_CV_NAME])dnl
+])
+
+CHECK_ALIGNOF(short)
+CHECK_ALIGNOF(int)
+CHECK_ALIGNOF(long)
+if [[ $HAVE_LONG_LONG_INT_64 -eq 1 ]] ; then
+ CHECK_ALIGNOF(long long int)
+fi
+CHECK_ALIGNOF(double)
+
+dnl Compute maximum alignment of any basic type.
+dnl We assume long's alignment is at least as strong as char, short, or int;
+dnl but we must check long long (if it exists) and double.
+
+if [[ $ac_cv_alignof_double != 'sizeof(double)' ]] ; then
+ MAX_ALIGNOF="$ac_cv_alignof_long"
+ if [[ $MAX_ALIGNOF -lt $ac_cv_alignof_double ]] ; then
+ MAX_ALIGNOF="$ac_cv_alignof_double"
+ fi
+ if [[ $HAVE_LONG_LONG_INT_64 -eq 1 ]] ; then
+ if [[ $MAX_ALIGNOF -lt $ac_cv_alignof_long_long_int ]] ; then
+ MAX_ALIGNOF="$ac_cv_alignof_long_long_int"
+ fi
+ fi
+else
+ dnl cross-compiling: assume that double's alignment is worst case
+ MAX_ALIGNOF="$ac_cv_alignof_double"
+fi
+AC_DEFINE_UNQUOTED(MAXIMUM_ALIGNOF, $MAX_ALIGNOF)
+
+
dnl Check to see if platform has POSIX signal interface.
dnl NOTE: if this test fails then POSIX signals definitely don't work.
dnl It could be that the test compiles but the POSIX routines don't
/* Define this as the appropriate snprintf format for 64-bit ints, if any */
#undef INT64_FORMAT
+/* These must be defined as the alignment requirement (NOT the size) of
+ * each of the basic C data types (except char, which we assume has align 1).
+ * MAXIMUM_ALIGNOF is the largest alignment requirement for any C data type.
+ * ALIGNOF_LONG_LONG_INT need only be defined if HAVE_LONG_LONG_INT_64 is.
+ */
+#undef ALIGNOF_SHORT
+#undef ALIGNOF_INT
+#undef ALIGNOF_LONG
+#undef ALIGNOF_LONG_LONG_INT
+#undef ALIGNOF_DOUBLE
+#undef MAXIMUM_ALIGNOF
+
/* Define as the base type of the last arg to accept */
#undef SOCKET_SIZE_TYPE
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: memutils.h,v 1.22 1999/03/25 03:49:34 tgl Exp $
+ * $Id: memutils.h,v 1.23 1999/03/25 19:05:19 tgl Exp $
*
* NOTES
* some of the information in this file will be moved to
/* ----------------
* Alignment macros: align a length or address appropriately for a given type.
*
- * It'd be best to use offsetof to check how the compiler aligns stuff,
- * but not all compilers support that (still true)? So we make the
- * conservative assumption that a type must be aligned on a boundary equal
- * to its own size, except on a few architectures where we know better.
+ * There used to be some incredibly crufty platform-dependent hackery here,
+ * but now we rely on the configure script to get the info for us. Much nicer.
*
- * CAUTION: for the system tables, the struct declarations found in
- * src/include/pg_*.h had better be interpreted by the compiler in a way
- * that agrees with the workings of these macros. In practice that means
- * being careful to lay out the columns of a system table in a way that avoids
- * wasted pad space.
- *
- * CAUTION: _ALIGN will not work if sizeof(TYPE) is not a power of 2.
- * There are machines where sizeof(double) is not, for example.
- * But such a size is almost certainly not an alignment boundary anyway.
+ * NOTE: _ALIGN will not work if ALIGNVAL is not a power of 2.
+ * That case seems extremely unlikely to occur in practice, however.
* ----------------
*/
-#define _ALIGN(TYPE,LEN) \
- (((long)(LEN) + (sizeof(TYPE) - 1)) & ~(sizeof(TYPE) - 1))
-
-#define SHORTALIGN(LEN) _ALIGN(short, (LEN))
-
-#if defined(m68k)
-#define INTALIGN(LEN) _ALIGN(short, (LEN))
-#else
-#define INTALIGN(LEN) _ALIGN(int, (LEN))
-#endif
-
-#if (defined(sun) && ! defined(sparc)) || defined(m68k)
-#define LONGALIGN(LEN) _ALIGN(short, (LEN))
-#else
-#define LONGALIGN(LEN) _ALIGN(long, (LEN))
-#endif
-
-#if defined(m68k)
-#define DOUBLEALIGN(LEN) _ALIGN(short, (LEN))
-#define MAXALIGN(LEN) _ALIGN(short, (LEN))
-#elif defined(sco)
-#define DOUBLEALIGN(LEN) _ALIGN(int, (LEN))
-#define MAXALIGN(LEN) _ALIGN(int, (LEN))
-#else
-#define DOUBLEALIGN(LEN) _ALIGN(double, (LEN))
-#define MAXALIGN(LEN) _ALIGN(double, (LEN))
-#endif
+#define _ALIGN(ALIGNVAL,LEN) (((long)(LEN) + (ALIGNVAL-1)) & ~(ALIGNVAL-1))
+
+#define SHORTALIGN(LEN) _ALIGN(ALIGNOF_SHORT, (LEN))
+#define INTALIGN(LEN) _ALIGN(ALIGNOF_INT, (LEN))
+#define LONGALIGN(LEN) _ALIGN(ALIGNOF_LONG, (LEN))
+#define DOUBLEALIGN(LEN) _ALIGN(ALIGNOF_DOUBLE, (LEN))
+#define MAXALIGN(LEN) _ALIGN(MAXIMUM_ALIGNOF, (LEN))
/*****************************************************************************
* oset.h -- Fixed format ordered set definitions. *