1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

When using 'long long int' for int64 type, check to see if the compiler

accepts nnnLL syntax for long long constants.  If so, decorate the CRC64
constants with LL to avoid warnings and/or erroneous results from certain
non-standards-compliant compilers.
This commit is contained in:
Tom Lane
2001-03-23 18:42:12 +00:00
parent 32924c1c90
commit e458ebfd21
5 changed files with 230 additions and 180 deletions

121
configure vendored
View File

@ -6996,10 +6996,37 @@ fi
if [ x"$HAVE_LONG_LONG_INT_64" = xyes ] ; then
cat > conftest.$ac_ext <<EOF
#line 7002 "configure"
#include "confdefs.h"
#define INT64CONST(x) x##LL
long long int foo = INT64CONST(0x1234567890123456);
int main() {
; return 0; }
EOF
if { (eval echo configure:7012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_LL_CONSTANTS 1
EOF
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi
if [ x"$HAVE_LONG_LONG_INT_64" = xyes ] ; then
if [ x$SNPRINTF = x ] ; then
echo $ac_n "checking whether snprintf handles 'long long int' as %lld""... $ac_c" 1>&6
echo "configure:7003: checking whether snprintf handles 'long long int' as %lld" >&5
echo "configure:7030: checking whether snprintf handles 'long long int' as %lld" >&5
if test "$cross_compiling" = yes; then
echo "$ac_t""assuming not on target machine" 1>&6
# Force usage of our own snprintf, since we cannot test foreign snprintf
@ -7008,7 +7035,7 @@ echo "configure:7003: checking whether snprintf handles 'long long int' as %lld"
else
cat > conftest.$ac_ext <<EOF
#line 7012 "configure"
#line 7039 "configure"
#include "confdefs.h"
#include <stdio.h>
typedef long long int int64;
@ -7035,7 +7062,7 @@ main() {
exit(! does_int64_snprintf_work());
}
EOF
if { (eval echo configure:7039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo "$ac_t""yes" 1>&6
INT64_FORMAT='"%lld"'
@ -7046,7 +7073,7 @@ else
rm -fr conftest*
echo "$ac_t""no" 1>&6
echo $ac_n "checking whether snprintf handles 'long long int' as %qd""... $ac_c" 1>&6
echo "configure:7050: checking whether snprintf handles 'long long int' as %qd" >&5
echo "configure:7077: checking whether snprintf handles 'long long int' as %qd" >&5
if test "$cross_compiling" = yes; then
echo "$ac_t""assuming not on target machine" 1>&6
# Force usage of our own snprintf, since we cannot test foreign snprintf
@ -7055,7 +7082,7 @@ echo "configure:7050: checking whether snprintf handles 'long long int' as %qd"
else
cat > conftest.$ac_ext <<EOF
#line 7059 "configure"
#line 7086 "configure"
#include "confdefs.h"
#include <stdio.h>
typedef long long int int64;
@ -7082,7 +7109,7 @@ main() {
exit(! does_int64_snprintf_work());
}
EOF
if { (eval echo configure:7086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo "$ac_t""yes" 1>&6
INT64_FORMAT='"%qd"'
@ -7122,12 +7149,12 @@ EOF
for ac_func in strtoll strtoq
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7126: checking for $ac_func" >&5
echo "configure:7153: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7131 "configure"
#line 7158 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -7150,7 +7177,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:7154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:7181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -7177,12 +7204,12 @@ done
for ac_func in strtoull strtouq
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7181: checking for $ac_func" >&5
echo "configure:7208: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7186 "configure"
#line 7213 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -7205,7 +7232,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:7209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:7236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -7231,12 +7258,12 @@ done
echo $ac_n "checking for atexit""... $ac_c" 1>&6
echo "configure:7235: checking for atexit" >&5
echo "configure:7262: checking for atexit" >&5
if eval "test \"`echo '$''{'ac_cv_func_atexit'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7240 "configure"
#line 7267 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char atexit(); below. */
@ -7259,7 +7286,7 @@ atexit();
; return 0; }
EOF
if { (eval echo configure:7263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:7290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_atexit=yes"
else
@ -7282,12 +7309,12 @@ else
for ac_func in on_exit
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7286: checking for $ac_func" >&5
echo "configure:7313: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7291 "configure"
#line 7318 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -7310,7 +7337,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:7314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:7341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -7343,7 +7370,7 @@ fi
echo $ac_n "checking size of unsigned long""... $ac_c" 1>&6
echo "configure:7347: checking size of unsigned long" >&5
echo "configure:7374: 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
@ -7351,7 +7378,7 @@ else
ac_cv_sizeof_unsigned_long=4
else
cat > conftest.$ac_ext <<EOF
#line 7355 "configure"
#line 7382 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@ -7362,7 +7389,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7393: \"$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
@ -7388,7 +7415,7 @@ EOF
echo $ac_n "checking alignment of short""... $ac_c" 1>&6
echo "configure:7392: checking alignment of short" >&5
echo "configure:7419: 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
@ -7396,7 +7423,7 @@ else
pgac_cv_alignof_short='sizeof(short)'
else
cat > conftest.$ac_ext <<EOF
#line 7400 "configure"
#line 7427 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; short field; } mystruct;
@ -7408,7 +7435,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7439: \"$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
@ -7428,7 +7455,7 @@ EOF
echo $ac_n "checking alignment of int""... $ac_c" 1>&6
echo "configure:7432: checking alignment of int" >&5
echo "configure:7459: 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
@ -7436,7 +7463,7 @@ else
pgac_cv_alignof_int='sizeof(int)'
else
cat > conftest.$ac_ext <<EOF
#line 7440 "configure"
#line 7467 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; int field; } mystruct;
@ -7448,7 +7475,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7479: \"$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
@ -7468,7 +7495,7 @@ EOF
echo $ac_n "checking alignment of long""... $ac_c" 1>&6
echo "configure:7472: checking alignment of long" >&5
echo "configure:7499: 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
@ -7476,7 +7503,7 @@ else
pgac_cv_alignof_long='sizeof(long)'
else
cat > conftest.$ac_ext <<EOF
#line 7480 "configure"
#line 7507 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; long field; } mystruct;
@ -7488,7 +7515,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7519: \"$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
@ -7509,7 +7536,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:7513: checking alignment of long long int" >&5
echo "configure:7540: 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
@ -7517,7 +7544,7 @@ else
pgac_cv_alignof_long_long_int='sizeof(long long int)'
else
cat > conftest.$ac_ext <<EOF
#line 7521 "configure"
#line 7548 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; long long int field; } mystruct;
@ -7529,7 +7556,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7560: \"$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
@ -7550,7 +7577,7 @@ EOF
fi
echo $ac_n "checking alignment of double""... $ac_c" 1>&6
echo "configure:7554: checking alignment of double" >&5
echo "configure:7581: 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
@ -7558,7 +7585,7 @@ else
pgac_cv_alignof_double='sizeof(double)'
else
cat > conftest.$ac_ext <<EOF
#line 7562 "configure"
#line 7589 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; double field; } mystruct;
@ -7570,7 +7597,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7601: \"$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
@ -7608,12 +7635,12 @@ EOF
echo $ac_n "checking for POSIX signal interface""... $ac_c" 1>&6
echo "configure:7612: checking for POSIX signal interface" >&5
echo "configure:7639: 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 7617 "configure"
#line 7644 "configure"
#include "confdefs.h"
#include <signal.h>
@ -7624,7 +7651,7 @@ act.sa_flags = SA_RESTART;
sigaction(0, &act, &oact);
; return 0; }
EOF
if { (eval echo configure:7628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:7655: \"$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
@ -7654,7 +7681,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:7658: checking for $ac_word" >&5
echo "configure:7685: 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
@ -7690,7 +7717,7 @@ test -n "$TCLSH" && break
done
echo $ac_n "checking for tclConfig.sh""... $ac_c" 1>&6
echo "configure:7694: checking for tclConfig.sh" >&5
echo "configure:7721: checking for tclConfig.sh" >&5
# Let user override test
if test -z "$TCL_CONFIG_SH"; then
pgac_test_dirs="$with_tclconfig"
@ -7723,7 +7750,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:7727: checking for tkConfig.sh" >&5
echo "configure:7754: checking for tkConfig.sh" >&5
# Let user override test
if test -z "$TK_CONFIG_SH"; then
pgac_test_dirs="$with_tkconfig $with_tclconfig"
@ -7762,7 +7789,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:7766: checking for $ac_word" >&5
echo "configure:7793: 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
@ -7798,7 +7825,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:7802: checking for $ac_word" >&5
echo "configure:7829: 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
@ -7829,7 +7856,7 @@ done
echo $ac_n "checking for DocBook V3.1""... $ac_c" 1>&6
echo "configure:7833: checking for DocBook V3.1" >&5
echo "configure:7860: 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
@ -7862,7 +7889,7 @@ have_docbook=$pgac_cv_check_docbook
echo $ac_n "checking for DocBook stylesheets""... $ac_c" 1>&6
echo "configure:7866: checking for DocBook stylesheets" >&5
echo "configure:7893: 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
@ -7901,7 +7928,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:7905: checking for $ac_word" >&5
echo "configure:7932: 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