1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Fix portability problems recently exposed by regression tests on Alphas.

1. Distinguish cases where a Datum representing a tuple datatype is an OID
from cases where it is a pointer to TupleTableSlot, and make sure we use
the right typlen in each case.
2. Make fetchatt() and related code support 8-byte by-value datatypes on
machines where Datum is 8 bytes.  Centralize knowledge of the available
by-value datatype sizes in two macros in tupmacs.h, so that this will be
easier if we ever have to do it again.
This commit is contained in:
Tom Lane
2000-12-27 23:59:14 +00:00
parent 97799fc475
commit 8609d4abf2
23 changed files with 497 additions and 660 deletions

97
configure vendored
View File

@ -7206,8 +7206,53 @@ done
echo $ac_n "checking size of unsigned long""... $ac_c" 1>&6
echo "configure:7211: checking size of unsigned long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
ac_cv_sizeof_unsigned_long=4
else
cat > conftest.$ac_ext <<EOF
#line 7219 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
fprintf(f, "%d\n", sizeof(unsigned long));
exit(0);
}
EOF
if { (eval echo configure:7230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_unsigned_long=`cat conftestval`
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
ac_cv_sizeof_unsigned_long=0
fi
rm -fr conftest*
fi
fi
echo "$ac_t""$ac_cv_sizeof_unsigned_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long
EOF
cat >> confdefs.h <<EOF
#define SIZEOF_DATUM $ac_cv_sizeof_unsigned_long
EOF
echo $ac_n "checking alignment of short""... $ac_c" 1>&6
echo "configure:7211: checking alignment of short" >&5
echo "configure:7256: checking alignment of short" >&5
if eval "test \"`echo '$''{'pgac_cv_alignof_short'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7215,7 +7260,7 @@ else
pgac_cv_alignof_short='sizeof(short)'
else
cat > conftest.$ac_ext <<EOF
#line 7219 "configure"
#line 7264 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; short field; } mystruct;
@ -7227,7 +7272,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pgac_cv_alignof_short=`cat conftestval`
else
@ -7247,7 +7292,7 @@ EOF
echo $ac_n "checking alignment of int""... $ac_c" 1>&6
echo "configure:7251: checking alignment of int" >&5
echo "configure:7296: checking alignment of int" >&5
if eval "test \"`echo '$''{'pgac_cv_alignof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7255,7 +7300,7 @@ else
pgac_cv_alignof_int='sizeof(int)'
else
cat > conftest.$ac_ext <<EOF
#line 7259 "configure"
#line 7304 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; int field; } mystruct;
@ -7267,7 +7312,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pgac_cv_alignof_int=`cat conftestval`
else
@ -7287,7 +7332,7 @@ EOF
echo $ac_n "checking alignment of long""... $ac_c" 1>&6
echo "configure:7291: checking alignment of long" >&5
echo "configure:7336: checking alignment of long" >&5
if eval "test \"`echo '$''{'pgac_cv_alignof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7295,7 +7340,7 @@ else
pgac_cv_alignof_long='sizeof(long)'
else
cat > conftest.$ac_ext <<EOF
#line 7299 "configure"
#line 7344 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; long field; } mystruct;
@ -7307,7 +7352,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pgac_cv_alignof_long=`cat conftestval`
else
@ -7328,7 +7373,7 @@ EOF
if [ x"$HAVE_LONG_LONG_INT_64" = xyes ] ; then
echo $ac_n "checking alignment of long long int""... $ac_c" 1>&6
echo "configure:7332: checking alignment of long long int" >&5
echo "configure:7377: checking alignment of long long int" >&5
if eval "test \"`echo '$''{'pgac_cv_alignof_long_long_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7336,7 +7381,7 @@ else
pgac_cv_alignof_long_long_int='sizeof(long long int)'
else
cat > conftest.$ac_ext <<EOF
#line 7340 "configure"
#line 7385 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; long long int field; } mystruct;
@ -7348,7 +7393,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pgac_cv_alignof_long_long_int=`cat conftestval`
else
@ -7369,7 +7414,7 @@ EOF
fi
echo $ac_n "checking alignment of double""... $ac_c" 1>&6
echo "configure:7373: checking alignment of double" >&5
echo "configure:7418: checking alignment of double" >&5
if eval "test \"`echo '$''{'pgac_cv_alignof_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7377,7 +7422,7 @@ else
pgac_cv_alignof_double='sizeof(double)'
else
cat > conftest.$ac_ext <<EOF
#line 7381 "configure"
#line 7426 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; double field; } mystruct;
@ -7389,7 +7434,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pgac_cv_alignof_double=`cat conftestval`
else
@ -7427,12 +7472,12 @@ EOF
echo $ac_n "checking for POSIX signal interface""... $ac_c" 1>&6
echo "configure:7431: checking for POSIX signal interface" >&5
echo "configure:7476: checking for POSIX signal interface" >&5
if eval "test \"`echo '$''{'pgac_cv_func_posix_signals'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7436 "configure"
#line 7481 "configure"
#include "confdefs.h"
#include <signal.h>
@ -7443,7 +7488,7 @@ act.sa_flags = SA_RESTART;
sigaction(0, &act, &oact);
; return 0; }
EOF
if { (eval echo configure:7447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:7492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
pgac_cv_func_posix_signals=yes
else
@ -7473,7 +7518,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7477: checking for $ac_word" >&5
echo "configure:7522: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_TCLSH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7509,7 +7554,7 @@ test -n "$TCLSH" && break
done
echo $ac_n "checking for tclConfig.sh""... $ac_c" 1>&6
echo "configure:7513: checking for tclConfig.sh" >&5
echo "configure:7558: checking for tclConfig.sh" >&5
# Let user override test
if test -z "$TCL_CONFIG_SH"; then
pgac_test_dirs="$with_tclconfig"
@ -7542,7 +7587,7 @@ fi
# Check for Tk configuration script tkConfig.sh
if test "$with_tk" = yes; then
echo $ac_n "checking for tkConfig.sh""... $ac_c" 1>&6
echo "configure:7546: checking for tkConfig.sh" >&5
echo "configure:7591: checking for tkConfig.sh" >&5
# Let user override test
if test -z "$TK_CONFIG_SH"; then
pgac_test_dirs="$with_tkconfig $with_tclconfig"
@ -7581,7 +7626,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7585: checking for $ac_word" >&5
echo "configure:7630: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_NSGMLS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7617,7 +7662,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7621: checking for $ac_word" >&5
echo "configure:7666: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_JADE'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7648,7 +7693,7 @@ done
echo $ac_n "checking for DocBook V3.1""... $ac_c" 1>&6
echo "configure:7652: checking for DocBook V3.1" >&5
echo "configure:7697: checking for DocBook V3.1" >&5
if eval "test \"`echo '$''{'pgac_cv_check_docbook'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7681,7 +7726,7 @@ have_docbook=$pgac_cv_check_docbook
echo $ac_n "checking for DocBook stylesheets""... $ac_c" 1>&6
echo "configure:7685: checking for DocBook stylesheets" >&5
echo "configure:7730: checking for DocBook stylesheets" >&5
if eval "test \"`echo '$''{'pgac_cv_path_stylesheets'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7720,7 +7765,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7724: checking for $ac_word" >&5
echo "configure:7769: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_SGMLSPL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else