From 7b8644dcc1a0db95c3ea321ebb8bc059ab931b42 Mon Sep 17 00:00:00 2001 From: Richard Nyberg Date: Mon, 12 Jan 2009 22:09:26 +0100 Subject: Provide own implementation of asprintf if it's missing. --- misc/subr.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'misc/subr.h') diff --git a/misc/subr.h b/misc/subr.h index 73465b0..cec7586 100644 --- a/misc/subr.h +++ b/misc/subr.h @@ -1,8 +1,9 @@ #ifndef BTPD_SUBR_H #define BTPD_SUBR_H -#include #include +#include +#include #define max(x, y) ((x) >= (y) ? (x) : (y)) #define min(x, y) ((x) <= (y) ? (x) : (y)) @@ -47,4 +48,9 @@ void *read_file(const char *path, void *buf, size_t *size); char *find_btpd_dir(void); int make_abs_path(const char *in, char *out); +#ifndef HAVE_ASPRINTF +__attribute__((format (printf, 2, 3))) +int asprintf(char **strp, const char *fmt, ...); +#endif + #endif -- cgit 1.4.1