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
cac18a76
Commit
cac18a76
authored
May 18, 2015
by
Noah Misch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Permit use of vsprintf() in PostgreSQL code.
The next commit needs it. Back-patch to 9.0 (all supported versions).
parent
b0ce3850
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
src/include/port.h
src/include/port.h
+6
-0
src/port/snprintf.c
src/port/snprintf.c
+2
-1
No files found.
src/include/port.h
View file @
cac18a76
...
...
@@ -139,6 +139,9 @@ extern unsigned char pg_ascii_tolower(unsigned char ch);
#ifdef snprintf
#undef snprintf
#endif
#ifdef vsprintf
#undef vsprintf
#endif
#ifdef sprintf
#undef sprintf
#endif
...
...
@@ -154,6 +157,7 @@ extern unsigned char pg_ascii_tolower(unsigned char ch);
extern
int
pg_vsnprintf
(
char
*
str
,
size_t
count
,
const
char
*
fmt
,
va_list
args
);
extern
int
pg_snprintf
(
char
*
str
,
size_t
count
,
const
char
*
fmt
,...)
pg_attribute_printf
(
3
,
4
);
extern
int
pg_vsprintf
(
char
*
str
,
const
char
*
fmt
,
va_list
args
);
extern
int
pg_sprintf
(
char
*
str
,
const
char
*
fmt
,...)
pg_attribute_printf
(
2
,
3
);
extern
int
pg_vfprintf
(
FILE
*
stream
,
const
char
*
fmt
,
va_list
args
);
extern
int
pg_fprintf
(
FILE
*
stream
,
const
char
*
fmt
,...)
pg_attribute_printf
(
2
,
3
);
...
...
@@ -167,6 +171,7 @@ extern int pg_printf(const char *fmt,...) pg_attribute_printf(1, 2);
#ifdef __GNUC__
#define vsnprintf(...) pg_vsnprintf(__VA_ARGS__)
#define snprintf(...) pg_snprintf(__VA_ARGS__)
#define vsprintf(...) pg_vsprintf(__VA_ARGS__)
#define sprintf(...) pg_sprintf(__VA_ARGS__)
#define vfprintf(...) pg_vfprintf(__VA_ARGS__)
#define fprintf(...) pg_fprintf(__VA_ARGS__)
...
...
@@ -174,6 +179,7 @@ extern int pg_printf(const char *fmt,...) pg_attribute_printf(1, 2);
#else
#define vsnprintf pg_vsnprintf
#define snprintf pg_snprintf
#define vsprintf pg_vsprintf
#define sprintf pg_sprintf
#define vfprintf pg_vfprintf
#define fprintf pg_fprintf
...
...
src/port/snprintf.c
View file @
cac18a76
...
...
@@ -99,6 +99,7 @@
/* Prevent recursion */
#undef vsnprintf
#undef snprintf
#undef vsprintf
#undef sprintf
#undef vfprintf
#undef fprintf
...
...
@@ -178,7 +179,7 @@ pg_snprintf(char *str, size_t count, const char *fmt,...)
return
len
;
}
static
int
int
pg_vsprintf
(
char
*
str
,
const
char
*
fmt
,
va_list
args
)
{
PrintfTarget
target
;
...
...
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