diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/common/fe_memutils.h | 1 | ||||
-rw-r--r-- | src/include/pg_config.h.in | 3 | ||||
-rw-r--r-- | src/include/port.h | 5 | ||||
-rw-r--r-- | src/include/utils/palloc.h | 2 |
4 files changed, 11 insertions, 0 deletions
diff --git a/src/include/common/fe_memutils.h b/src/include/common/fe_memutils.h index 82ed8cd9e64..db4e710b465 100644 --- a/src/include/common/fe_memutils.h +++ b/src/include/common/fe_memutils.h @@ -14,6 +14,7 @@ extern void *pg_malloc(size_t size); extern void *pg_malloc0(size_t size); extern void *pg_realloc(void *pointer, size_t size); extern void pg_free(void *pointer); +extern int pg_asprintf(char **ret, const char *format, ...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); #include "utils/palloc.h" diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index 5eac52d93a9..0250e39dbbb 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -87,6 +87,9 @@ /* Define to 1 if you have the `append_history' function. */ #undef HAVE_APPEND_HISTORY +/* Define to 1 if you have the `asprintf' function. */ +#undef HAVE_ASPRINTF + /* Define to 1 if you have the `cbrt' function. */ #undef HAVE_CBRT diff --git a/src/include/port.h b/src/include/port.h index 5ef4b0a0b11..0b9dfc81e2a 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -404,6 +404,11 @@ extern double rint(double x); extern int inet_aton(const char *cp, struct in_addr * addr); #endif +#ifndef HAVE_ASPRINTF +extern int asprintf(char **ret, const char *fmt, ...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); +extern int vasprintf(char **ret, const char *fmt, va_list ap) __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 0))); +#endif + #if !HAVE_DECL_STRLCAT extern size_t strlcat(char *dst, const char *src, size_t siz); #endif diff --git a/src/include/utils/palloc.h b/src/include/utils/palloc.h index 01e7db5d4f9..03ef87e2d7f 100644 --- a/src/include/utils/palloc.h +++ b/src/include/utils/palloc.h @@ -101,5 +101,7 @@ extern void *palloc(Size size); extern void *palloc0(Size size); extern void pfree(void *pointer); extern void *repalloc(void *pointer, Size size); +extern char *psprintf(const char *format, ...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); +extern char *pvsprintf(const char *format, va_list ap) __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 0))); #endif /* PALLOC_H */ |