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
e71d09a4
Commit
e71d09a4
authored
Feb 24, 2005
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up printf arg-control test, per Kurt Roeckx.
parent
41994145
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
21 deletions
+17
-21
config/c-library.m4
config/c-library.m4
+9
-11
configure
configure
+8
-10
No files found.
config/c-library.m4
View file @
e71d09a4
# Macros that test various C library quirks
# Macros that test various C library quirks
# $PostgreSQL: pgsql/config/c-library.m4,v 1.3
0 2005/02/22 03:55:50 momjian
Exp $
# $PostgreSQL: pgsql/config/c-library.m4,v 1.3
1 2005/02/24 01:34:45 tgl
Exp $
# PGAC_VAR_INT_TIMEZONE
# PGAC_VAR_INT_TIMEZONE
...
@@ -273,25 +273,23 @@ esac])# PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT
...
@@ -273,25 +273,23 @@ esac])# PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT
# Determine if printf supports %1$ argument selection, e.g. %5$ selects
# Determine if printf supports %1$ argument selection, e.g. %5$ selects
# the fifth argument after the printf print string.
# the fifth argument after the printf print string.
# This is not in the C99 standard, but in the Single Unix Specification (SUS).
# This is not in the C99 standard, but in the Single Unix Specification (SUS).
# It is used in our lang
au
ge translation strings.
# It is used in our lang
ua
ge translation strings.
#
#
AC_DEFUN([PGAC_FUNC_PRINTF_ARG_CONTROL],
AC_DEFUN([PGAC_FUNC_PRINTF_ARG_CONTROL],
[AC_MSG_CHECKING([printf supports argument control])
[AC_MSG_CHECKING([
whether
printf supports argument control])
AC_CACHE_VAL(pgac_cv_printf_arg_control,
AC_CACHE_VAL(pgac_cv_printf_arg_control,
[AC_TRY_RUN([#include <stdio.h>
[AC_TRY_RUN([#include <stdio.h>
#include <string.h>
int
does_printf_have_arg_control
()
int
main
()
{
{
char buf[100];
char buf[100];
/* can it swap arguments? */
/* can it swap arguments? */
snprintf(buf, 100, "%2$d|%1$d", 3, 4);
snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
if (strcmp(buf, "4|3") != 0)
if (strcmp(buf, "4 3") != 0)
return 0;
return 1;
return 1;
}
return 0;
main() {
exit(! does_printf_have_arg_control());
}],
}],
[pgac_cv_printf_arg_control=yes],
[pgac_cv_printf_arg_control=yes],
[pgac_cv_printf_arg_control=no],
[pgac_cv_printf_arg_control=no],
...
...
configure
View file @
e71d09a4
...
@@ -12162,8 +12162,8 @@ fi
...
@@ -12162,8 +12162,8 @@ fi
done
done
echo
"
$as_me
:
$LINENO
: checking printf supports argument control"
>
&5
echo
"
$as_me
:
$LINENO
: checking
whether
printf supports argument control"
>
&5
echo
$ECHO_N
"checking printf supports argument control...
$ECHO_C
"
>
&6
echo
$ECHO_N
"checking
whether
printf supports argument control...
$ECHO_C
"
>
&6
if
test
"
${
pgac_cv_printf_arg_control
+set
}
"
=
set
;
then
if
test
"
${
pgac_cv_printf_arg_control
+set
}
"
=
set
;
then
echo
$ECHO_N
"(cached)
$ECHO_C
"
>
&6
echo
$ECHO_N
"(cached)
$ECHO_C
"
>
&6
else
else
...
@@ -12174,19 +12174,17 @@ else
...
@@ -12174,19 +12174,17 @@ else
#line
$LINENO
"configure"
#line
$LINENO
"configure"
#include "confdefs.h"
#include "confdefs.h"
#include <stdio.h>
#include <stdio.h>
#include <string.h>
int
does_printf_have_arg_control
()
int
main
()
{
{
char buf[100];
char buf[100];
/* can it swap arguments? */
/* can it swap arguments? */
snprintf(buf, 100, "%2
$d
|%1
$d
", 3, 4);
snprintf(buf, 100, "%2
\$
d %1
\$
d", 3, 4);
if (strcmp(buf, "4|3") != 0)
if (strcmp(buf, "4 3") != 0)
return 0;
return 1;
return 1;
}
return 0;
main() {
exit(! does_printf_have_arg_control());
}
}
_ACEOF
_ACEOF
rm
-f
conftest
$ac_exeext
rm
-f
conftest
$ac_exeext
...
...
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