about summary refs log tree commit diff
path: root/misc/subr.h
diff options
context:
space:
mode:
authorRichard Nyberg <rnyberg@murmeldjur.se>2009-01-12 22:09:26 +0100
committerRichard Nyberg <rnyberg@murmeldjur.se>2009-01-12 23:43:35 +0100
commit7b8644dcc1a0db95c3ea321ebb8bc059ab931b42 (patch)
treefb4b0ad2985e42a66c982b15d79eaf0019f098e3 /misc/subr.h
parentb50a306ca3966dc056974c39e72e19da41ad873b (diff)
downloadbtpd-7b8644dcc1a0db95c3ea321ebb8bc059ab931b42.tar.gz
btpd-7b8644dcc1a0db95c3ea321ebb8bc059ab931b42.zip
Provide own implementation of asprintf if it's missing.
Diffstat (limited to 'misc/subr.h')
-rw-r--r--misc/subr.h8
1 files changed, 7 insertions, 1 deletions
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 <stdio.h>
 #include <stdarg.h>
+#include <stdio.h>
+#include <stdint.h>
 
 #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