Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf1430ce

Browse files
committed
Move PGAC_FUNC_PRINTF_ARG_CONTROL to just above snprintf 64-bit tests so
its output can be used to select the proper printf outputs.
1 parent949ab3c commitf1430ce

File tree

2 files changed

+75
-75
lines changed

2 files changed

+75
-75
lines changed

‎configure

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -14809,6 +14809,68 @@ fi
1480914809
# snprintfs that use %lld, %qd, or %I64d as the format. If none of these
1481014810
# work, fall back to our own snprintf emulation (which we know uses %lld).
1481114811

14812+
# Also force use of our snprintf if system's doesn't do arg control
14813+
if test $pgac_need_repl_snprintf = no; then
14814+
echo "$as_me:$LINENO: checking whether printf supports argument control" >&5
14815+
echo $ECHO_N "checking whether printf supports argument control... $ECHO_C" >&6
14816+
if test "${pgac_cv_printf_arg_control+set}" = set; then
14817+
echo $ECHO_N "(cached) $ECHO_C" >&6
14818+
else
14819+
if test "$cross_compiling" = yes; then
14820+
pgac_cv_printf_arg_control=cross
14821+
else
14822+
cat >conftest.$ac_ext <<_ACEOF
14823+
#line $LINENO "configure"
14824+
#include "confdefs.h"
14825+
#include <stdio.h>
14826+
#include <string.h>
14827+
14828+
int main()
14829+
{
14830+
char buf[100];
14831+
14832+
/* can it swap arguments? */
14833+
snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
14834+
if (strcmp(buf, "4 3") != 0)
14835+
return 1;
14836+
return 0;
14837+
}
14838+
_ACEOF
14839+
rm -f conftest$ac_exeext
14840+
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
14841+
(eval $ac_link) 2>&5
14842+
ac_status=$?
14843+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
14844+
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14845+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
14846+
(eval $ac_try) 2>&5
14847+
ac_status=$?
14848+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
14849+
(exit $ac_status); }; }; then
14850+
pgac_cv_printf_arg_control=yes
14851+
else
14852+
echo "$as_me: program exited with status $ac_status" >&5
14853+
echo "$as_me: failed program was:" >&5
14854+
cat conftest.$ac_ext >&5
14855+
( exit $ac_status )
14856+
pgac_cv_printf_arg_control=no
14857+
fi
14858+
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14859+
fi
14860+
14861+
fi
14862+
echo "$as_me:$LINENO: result: $pgac_cv_printf_arg_control" >&5
14863+
echo "${ECHO_T}$pgac_cv_printf_arg_control" >&6
14864+
14865+
if test $pgac_cv_printf_arg_control != yes ; then
14866+
pgac_need_repl_snprintf=yes
14867+
fi
14868+
fi
14869+
14870+
if test $pgac_need_repl_snprintf = yes; then
14871+
LIBOBJS="$LIBOBJS snprintf.$ac_objext"
14872+
fi
14873+
1481214874
if test "$HAVE_LONG_LONG_INT_64" = yes ; then
1481314875
if test $pgac_need_repl_snprintf = no; then
1481414876
echo "$as_me:$LINENO: checking snprintf format for long long int" >&5
@@ -14911,68 +14973,6 @@ cat >>confdefs.h <<_ACEOF
1491114973
_ACEOF
1491214974

1491314975

14914-
# Also force use of our snprintf if system's doesn't do arg control
14915-
if test $pgac_need_repl_snprintf = no; then
14916-
echo "$as_me:$LINENO: checking whether printf supports argument control" >&5
14917-
echo $ECHO_N "checking whether printf supports argument control... $ECHO_C" >&6
14918-
if test "${pgac_cv_printf_arg_control+set}" = set; then
14919-
echo $ECHO_N "(cached) $ECHO_C" >&6
14920-
else
14921-
if test "$cross_compiling" = yes; then
14922-
pgac_cv_printf_arg_control=cross
14923-
else
14924-
cat >conftest.$ac_ext <<_ACEOF
14925-
#line $LINENO "configure"
14926-
#include "confdefs.h"
14927-
#include <stdio.h>
14928-
#include <string.h>
14929-
14930-
int main()
14931-
{
14932-
char buf[100];
14933-
14934-
/* can it swap arguments? */
14935-
snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
14936-
if (strcmp(buf, "4 3") != 0)
14937-
return 1;
14938-
return 0;
14939-
}
14940-
_ACEOF
14941-
rm -f conftest$ac_exeext
14942-
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
14943-
(eval $ac_link) 2>&5
14944-
ac_status=$?
14945-
echo "$as_me:$LINENO: \$? = $ac_status" >&5
14946-
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14947-
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
14948-
(eval $ac_try) 2>&5
14949-
ac_status=$?
14950-
echo "$as_me:$LINENO: \$? = $ac_status" >&5
14951-
(exit $ac_status); }; }; then
14952-
pgac_cv_printf_arg_control=yes
14953-
else
14954-
echo "$as_me: program exited with status $ac_status" >&5
14955-
echo "$as_me: failed program was:" >&5
14956-
cat conftest.$ac_ext >&5
14957-
( exit $ac_status )
14958-
pgac_cv_printf_arg_control=no
14959-
fi
14960-
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14961-
fi
14962-
14963-
fi
14964-
echo "$as_me:$LINENO: result: $pgac_cv_printf_arg_control" >&5
14965-
echo "${ECHO_T}$pgac_cv_printf_arg_control" >&6
14966-
14967-
if test $pgac_cv_printf_arg_control != yes ; then
14968-
pgac_need_repl_snprintf=yes
14969-
fi
14970-
fi
14971-
14972-
if test $pgac_need_repl_snprintf = yes; then
14973-
LIBOBJS="$LIBOBJS snprintf.$ac_objext"
14974-
fi
14975-
1497614976
# Need a #define for the size of Datum (unsigned long)
1497714977
echo "$as_me:$LINENO: checking for unsigned long" >&5
1497814978
echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6

‎configure.in

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.401 2005/02/24 02:12:15 tgl Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.402 2005/02/28 20:36:05 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -1104,6 +1104,18 @@ fi
11041104
# snprintfs that use %lld, %qd, or %I64d as the format. If none of these
11051105
# work, fall back to our own snprintf emulation (which we know uses %lld).
11061106

1107+
# Also force use of our snprintf if system's doesn't do arg control
1108+
if test $pgac_need_repl_snprintf = no; then
1109+
PGAC_FUNC_PRINTF_ARG_CONTROL
1110+
if test $pgac_cv_printf_arg_control != yes ; then
1111+
pgac_need_repl_snprintf=yes
1112+
fi
1113+
fi
1114+
1115+
if test $pgac_need_repl_snprintf = yes; then
1116+
AC_LIBOBJ(snprintf)
1117+
fi
1118+
11071119
if test "$HAVE_LONG_LONG_INT_64" = yes ; then
11081120
if test $pgac_need_repl_snprintf = no; then
11091121
PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT
@@ -1131,18 +1143,6 @@ AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT,
11311143
AC_DEFINE_UNQUOTED(UINT64_FORMAT, $UINT64_FORMAT,
11321144
[Define to the appropriate snprintf format for unsigned 64-bit ints, if any.])
11331145

1134-
# Also force use of our snprintf if system's doesn't do arg control
1135-
if test $pgac_need_repl_snprintf = no; then
1136-
PGAC_FUNC_PRINTF_ARG_CONTROL
1137-
if test $pgac_cv_printf_arg_control != yes ; then
1138-
pgac_need_repl_snprintf=yes
1139-
fi
1140-
fi
1141-
1142-
if test $pgac_need_repl_snprintf = yes; then
1143-
AC_LIBOBJ(snprintf)
1144-
fi
1145-
11461146
# Need a #define for the size of Datum (unsigned long)
11471147
AC_CHECK_SIZEOF([unsigned long])
11481148

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp