Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
ca430500
Commit
ca430500
authored
Dec 06, 2005
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add documentation on the use of *printf() macros and libintl.
Backpatch to 8.1.X.
parent
73f47aa0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
16 deletions
+63
-16
configure
configure
+29
-6
configure.in
configure.in
+30
-7
src/include/port.h
src/include/port.h
+4
-3
No files found.
configure
View file @
ca430500
...
...
@@ -13894,11 +13894,31 @@ fi
# have all the features we need --- see below.
if
test
"
$PORTNAME
"
=
"win32"
;
then
# Win32 gets this built unconditionally
# libintl versions prior to 0.13 use the native *printf functions.
# Win32 *printf does not understand %$, so on Win32 using pre-0.13 libintl
# it is necessary to use the pg versions of *printf to properly process
# NLS strings that use the %$ format.
# Win32 gets snprintf.c built unconditionally.
#
# To properly translate all NLS languages strings, we must support the
# *printf() %$ format, which allows *printf() arguments to be selected
# by position in the translated string.
#
# libintl versions < 0.13 use the native *printf() functions, and Win32
# *printf() doesn't understand %$, so we must use our /port versions,
# which do understand %$. libintl versions >= 0.13 include their own
# *printf versions on Win32. The libintl 0.13 release note text is:
#
# C format strings with positions, as they arise when a translator
# needs to reorder a sentence, are now supported on all platforms.
# On those few platforms (NetBSD and Woe32) for which the native
# printf()/fprintf()/... functions don't support such format
# strings, replacements are provided through <libintl.h>.
#
# We could use libintl >= 0.13's *printf() if we were sure that we had
# a litint >= 0.13 at runtime, but seeing that there is no clean way
# to guarantee that, it is best to just use our own, so we are sure to
# get %$ support. In include/port.h we disable the *printf() macros
# that might have been defined by libintl.
#
# We do this unconditionally whether NLS is used or not so we are sure
# that all Win32 libraries and binaries behave the same.
pgac_need_repl_snprintf
=
yes
else
pgac_need_repl_snprintf
=
no
...
...
@@ -17158,9 +17178,12 @@ fi
rm
-f
core
*
.core gmon.out bb.out conftest
$ac_exeext
conftest.
$ac_objext
conftest.
$ac_ext
fi
# --------------------
# Run tests below here
# --------------------
# Force use of our snprintf if system's doesn't do arg control
#
This feature is needed by NLS
#
See comment above at snprintf test for details.
if
test
"
$enable_nls
"
=
yes
-a
"
$pgac_need_repl_snprintf
"
=
no
;
then
echo
"
$as_me
:
$LINENO
: checking whether printf supports argument control"
>
&5
echo
$ECHO_N
"checking whether printf supports argument control...
$ECHO_C
"
>
&6
...
...
configure.in
View file @
ca430500
dnl Process this file with autoconf to produce a configure script.
dnl $PostgreSQL: pgsql/configure.in,v 1.43
5 2005/12/06 04:53:02
momjian Exp $
dnl $PostgreSQL: pgsql/configure.in,v 1.43
6 2005/12/06 18:35:09
momjian Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
...
...
@@ -858,11 +858,31 @@ fi
# have all the features we need --- see below.
if test "$PORTNAME" = "win32"; then
# Win32 gets this built unconditionally
# libintl versions prior to 0.13 use the native *printf functions.
# Win32 *printf does not understand %$, so on Win32 using pre-0.13 libintl
# it is necessary to use the pg versions of *printf to properly process
# NLS strings that use the %$ format.
# Win32 gets snprintf.c built unconditionally.
#
# To properly translate all NLS languages strings, we must support the
# *printf() %$ format, which allows *printf() arguments to be selected
# by position in the translated string.
#
# libintl versions < 0.13 use the native *printf() functions, and Win32
# *printf() doesn't understand %$, so we must use our /port versions,
# which do understand %$. libintl versions >= 0.13 include their own
# *printf versions on Win32. The libintl 0.13 release note text is:
#
# C format strings with positions, as they arise when a translator
# needs to reorder a sentence, are now supported on all platforms.
# On those few platforms (NetBSD and Woe32) for which the native
# printf()/fprintf()/... functions don't support such format
# strings, replacements are provided through <libintl.h>.
#
# We could use libintl >= 0.13's *printf() if we were sure that we had
# a litint >= 0.13 at runtime, but seeing that there is no clean way
# to guarantee that, it is best to just use our own, so we are sure to
# get %$ support. In include/port.h we disable the *printf() macros
# that might have been defined by libintl.
#
# We do this unconditionally whether NLS is used or not so we are sure
# that all Win32 libraries and binaries behave the same.
pgac_need_repl_snprintf=yes
else
pgac_need_repl_snprintf=no
...
...
@@ -1059,9 +1079,12 @@ AC_MSG_ERROR([[
*** for the exact reason.]])],
[AC_MSG_RESULT([cross-compiling])])
# --------------------
# Run tests below here
# --------------------
# Force use of our snprintf if system's doesn't do arg control
#
This feature is needed by NLS
#
See comment above at snprintf test for details.
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
...
...
src/include/port.h
View file @
ca430500
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/port.h,v 1.8
6 2005/12/06 05:13:46 tgl
Exp $
* $PostgreSQL: pgsql/src/include/port.h,v 1.8
7 2005/12/06 18:35:10 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -115,8 +115,9 @@ extern unsigned char pg_tolower(unsigned char ch);
#ifdef USE_REPL_SNPRINTF
/*
* Some versions of libintl try to replace printf and friends with macros;
* if we are doing likewise, make sure our versions win.
* Versions of libintl >= 0.13 try to replace printf() and friends with
* macros to their own versions that understand the %$ format. We do the
* same, so disable their macros, if they exist.
*/
#ifdef vsnprintf
#undef vsnprintf
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment