@@ -15092,7 +15092,7 @@ if test "$PORTNAME" = "win32"; then
15092
15092
# strings, replacements are provided through <libintl.h>.
15093
15093
#
15094
15094
# We could use libintl >= 0.13's *printf() if we were sure that we had
15095
- # a litint >= 0.13 at runtime, but seeing that there is no clean way
15095
+ # a libintl >= 0.13 at runtime, but seeing that there is no clean way
15096
15096
# to guarantee that, it is best to just use our own, so we are sure to
15097
15097
# get %$ support. In include/port.h we disable the *printf() macros
15098
15098
# that might have been defined by libintl.
@@ -15924,7 +15924,6 @@ fi
15924
15924
15925
15925
15926
15926
15927
-
15928
15927
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long int is 64 bits" >&5
15929
15928
$as_echo_n "checking whether long int is 64 bits... " >&6; }
15930
15929
if ${pgac_cv_type_long_int_64+:} false; then :
@@ -16102,96 +16101,23 @@ cat >>confdefs.h <<_ACEOF
16102
16101
_ACEOF
16103
16102
16104
16103
16105
- # If we found "long int" is 64 bits, assume snprintf handles it. If
16106
- # we found we need to use "long long int", better check. We cope with
16107
- # snprintfs that use %lld, %qd, or %I64d as the format. If none of these
16108
- # work, fall back to our own snprintf emulation (which we know uses %lld).
16109
-
16110
- if test "$HAVE_LONG_LONG_INT_64" = yes ; then
16111
- if test $pgac_need_repl_snprintf = no; then
16112
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking snprintf length modifier for long long int" >&5
16113
- $as_echo_n "checking snprintf length modifier for long long int... " >&6; }
16114
- if ${pgac_cv_snprintf_long_long_int_modifier+:} false; then :
16115
- $as_echo_n "(cached) " >&6
16104
+ # Select the printf length modifier that goes with that, too.
16105
+ # (This used to be bound up with replacement-snprintf selection, but now
16106
+ # we assume that the native *printf functions use standard length modifiers.)
16107
+ if test x"$pg_int64_type" = x"long long int" ; then
16108
+ INT64_MODIFIER='"ll"'
16116
16109
else
16117
- for pgac_modifier in 'll' 'q' 'I64'; do
16118
- if test "$cross_compiling" = yes; then :
16119
- pgac_cv_snprintf_long_long_int_modifier=cross; break
16120
- else
16121
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16122
- /* end confdefs.h. */
16123
- #include <stdio.h>
16124
- #include <string.h>
16125
- typedef long long int ac_int64;
16126
- #define INT64_FORMAT "%${pgac_modifier}d"
16127
-
16128
- ac_int64 a = 20000001;
16129
- ac_int64 b = 40000005;
16130
-
16131
- int does_int64_snprintf_work()
16132
- {
16133
- ac_int64 c;
16134
- char buf[100];
16135
-
16136
- if (sizeof(ac_int64) != 8)
16137
- return 0; /* doesn't look like the right size */
16138
-
16139
- c = a * b;
16140
- snprintf(buf, 100, INT64_FORMAT, c);
16141
- if (strcmp(buf, "800000140000005") != 0)
16142
- return 0; /* either multiply or snprintf is busted */
16143
- return 1;
16144
- }
16145
-
16146
- int
16147
- main() {
16148
- return (! does_int64_snprintf_work());
16149
- }
16150
- _ACEOF
16151
- if ac_fn_c_try_run "$LINENO"; then :
16152
- pgac_cv_snprintf_long_long_int_modifier=$pgac_modifier; break
16110
+ INT64_MODIFIER='"l"'
16153
16111
fi
16154
- rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16155
- conftest.$ac_objext conftest.beam conftest.$ac_ext
16156
- fi
16157
-
16158
- done
16159
- fi
16160
-
16161
- LONG_LONG_INT_MODIFIER=''
16162
-
16163
- case $pgac_cv_snprintf_long_long_int_modifier in
16164
- cross) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot test (not on host machine)" >&5
16165
- $as_echo "cannot test (not on host machine)" >&6; };;
16166
- ?*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_long_long_int_modifier" >&5
16167
- $as_echo "$pgac_cv_snprintf_long_long_int_modifier" >&6; }
16168
- LONG_LONG_INT_MODIFIER=$pgac_cv_snprintf_long_long_int_modifier;;
16169
- *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
16170
- $as_echo "none" >&6; };;
16171
- esac
16172
- if test "$LONG_LONG_INT_MODIFIER" = ""; then
16173
- # Force usage of our own snprintf, since system snprintf is broken
16174
- pgac_need_repl_snprintf=yes
16175
- LONG_LONG_INT_MODIFIER='ll'
16176
- fi
16177
- else
16178
- # Here if we previously decided we needed to use our own snprintf
16179
- LONG_LONG_INT_MODIFIER='ll'
16180
- fi
16181
- else
16182
- # Here if we are not using 'long long int' at all
16183
- LONG_LONG_INT_MODIFIER='l'
16184
- fi
16185
-
16186
- INT64_MODIFIER="\"$LONG_LONG_INT_MODIFIER\""
16187
16112
16188
16113
16189
16114
cat >>confdefs.h <<_ACEOF
16190
16115
#define INT64_MODIFIER $INT64_MODIFIER
16191
16116
_ACEOF
16192
16117
16193
16118
16194
- # Also force use of our snprintf if the system's doesn't support the %z flag.
16119
+ # Force use of our snprintf if the system's doesn't support the %z flag.
16120
+ # (Note this test uses PG_INT64_TYPE and INT64_MODIFIER.)
16195
16121
if test "$pgac_need_repl_snprintf" = no; then
16196
16122
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf supports the %z modifier" >&5
16197
16123
$as_echo_n "checking whether snprintf supports the %z modifier... " >&6; }
0 commit comments