@@ -14526,6 +14526,65 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
1452614526fi
1452714527
1452814528
14529+ # Force use of our snprintf if system's doesn't do arg control
14530+ if test $pgac_need_repl_snprintf = no; then
14531+ echo "$as_me:$LINENO: checking whether printf supports argument control" >&5
14532+ echo $ECHO_N "checking whether printf supports argument control... $ECHO_C" >&6
14533+ if test "${pgac_cv_printf_arg_control+set}" = set; then
14534+ echo $ECHO_N "(cached) $ECHO_C" >&6
14535+ else
14536+ if test "$cross_compiling" = yes; then
14537+ pgac_cv_printf_arg_control=cross
14538+ else
14539+ cat >conftest.$ac_ext <<_ACEOF
14540+ #line $LINENO "configure"
14541+ #include "confdefs.h"
14542+ #include <stdio.h>
14543+ #include <string.h>
14544+
14545+ int main()
14546+ {
14547+ char buf[100];
14548+
14549+ /* can it swap arguments? */
14550+ snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
14551+ if (strcmp(buf, "4 3") != 0)
14552+ return 1;
14553+ return 0;
14554+ }
14555+ _ACEOF
14556+ rm -f conftest$ac_exeext
14557+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
14558+ (eval $ac_link) 2>&5
14559+ ac_status=$?
14560+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
14561+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14562+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
14563+ (eval $ac_try) 2>&5
14564+ ac_status=$?
14565+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
14566+ (exit $ac_status); }; }; then
14567+ pgac_cv_printf_arg_control=yes
14568+ else
14569+ echo "$as_me: program exited with status $ac_status" >&5
14570+ echo "$as_me: failed program was:" >&5
14571+ cat conftest.$ac_ext >&5
14572+ ( exit $ac_status )
14573+ pgac_cv_printf_arg_control=no
14574+ fi
14575+ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14576+ fi
14577+
14578+ fi
14579+ echo "$as_me:$LINENO: result: $pgac_cv_printf_arg_control" >&5
14580+ echo "${ECHO_T}$pgac_cv_printf_arg_control" >&6
14581+
14582+ if test $pgac_cv_printf_arg_control != yes ; then
14583+ pgac_need_repl_snprintf=yes
14584+ fi
14585+ fi
14586+
14587+
1452914588
1453014589echo "$as_me:$LINENO: checking whether long int is 64 bits" >&5
1453114590echo $ECHO_N "checking whether long int is 64 bits... $ECHO_C" >&6
@@ -14809,68 +14868,6 @@ fi
1480914868# snprintfs that use %lld, %qd, or %I64d as the format. If none of these
1481014869# work, fall back to our own snprintf emulation (which we know uses %lld).
1481114870
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-
1487414871if test "$HAVE_LONG_LONG_INT_64" = yes ; then
1487514872 if test $pgac_need_repl_snprintf = no; then
1487614873 echo "$as_me:$LINENO: checking snprintf format for long long int" >&5
@@ -14973,6 +14970,11 @@ cat >>confdefs.h <<_ACEOF
1497314970_ACEOF
1497414971
1497514972
14973+ # Now we have checked all the reasons to replace snprintf
14974+ if test $pgac_need_repl_snprintf = yes; then
14975+ LIBOBJS="$LIBOBJS snprintf.$ac_objext"
14976+ fi
14977+
1497614978# Need a #define for the size of Datum (unsigned long)
1497714979echo "$as_me:$LINENO: checking for unsigned long" >&5
1497814980echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6