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

Make Win32 build use our port/snprintf.c routines, instead of depending

on libintl which may or may not provide what we need.  Make a few marginal
cleanups to ensure this works.  Andrew Dunstan and Tom Lane.
This commit is contained in:
Tom Lane
2005-12-06 02:29:27 +00:00
parent dc68b9ec30
commit f244c488fb
8 changed files with 57 additions and 47 deletions

View File

@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
dnl $PostgreSQL: pgsql/configure.in,v 1.431 2005/11/05 04:01:41 pgsql Exp $
dnl $PostgreSQL: pgsql/configure.in,v 1.431.2.1 2005/12/06 02:29:25 tgl Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
@ -850,9 +850,14 @@ fi
# also decide to use snprintf.c if snprintf() is present but does not
# have all the features we need --- see below.
pgac_need_repl_snprintf=no
AC_CHECK_FUNCS(snprintf, [], pgac_need_repl_snprintf=yes)
AC_CHECK_FUNCS(vsnprintf, [], pgac_need_repl_snprintf=yes)
if test "$PORTNAME" = "win32"; then
# Win32 gets this built unconditionally
pgac_need_repl_snprintf=yes
else
pgac_need_repl_snprintf=no
AC_CHECK_FUNCS(snprintf, [], pgac_need_repl_snprintf=yes)
AC_CHECK_FUNCS(vsnprintf, [], pgac_need_repl_snprintf=yes)
fi
# Check whether <stdio.h> declares snprintf() and vsnprintf(); if not,
@ -1045,14 +1050,8 @@ AC_MSG_ERROR([[
# Force use of our snprintf if system's doesn't do arg control
# This feature is used by NLS
if test "$enable_nls" = yes &&
test $pgac_need_repl_snprintf = no &&
# On Win32, libintl replaces snprintf() with its own version that
# understands arg control, so we don't need our own. In fact, it
# also uses macros that conflict with ours, so we _can't_ use
# our own.
test "$PORTNAME" != "win32"; then
# This feature is needed by NLS
if test "$enable_nls" = yes -a "$pgac_need_repl_snprintf" = no; then
PGAC_FUNC_PRINTF_ARG_CONTROL
if test $pgac_cv_printf_arg_control != yes ; then
pgac_need_repl_snprintf=yes
@ -1127,7 +1126,7 @@ AC_DEFINE_UNQUOTED(UINT64_FORMAT, $UINT64_FORMAT,
# Now we have checked all the reasons to replace snprintf
if test $pgac_need_repl_snprintf = yes; then
AC_DEFINE(USE_SNPRINTF, 1, [Use replacement snprintf() functions.])
AC_DEFINE(USE_REPL_SNPRINTF, 1, [Use replacement snprintf() functions.])
AC_LIBOBJ(snprintf)
fi