]> arthur.barton.de Git - netatalk.git/commitdiff
Add asprint() compatibility function for systems lacking it
authorRalph Boehme <sloowfranklin@gmail.com>
Tue, 29 Oct 2013 10:05:59 +0000 (11:05 +0100)
committerRalph Boehme <sloowfranklin@gmail.com>
Tue, 29 Oct 2013 10:05:59 +0000 (11:05 +0100)
NEWS
configure.ac
libatalk/compat/misc.c

diff --git a/NEWS b/NEWS
index aa61935e63dc160147115074987c9774fad0faa3..1fd4eeb909bc8ef70bfac1cfe53d619824a9b68a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Changes in 3.1.1
+================
+* FIX: Add asprint() compatibility function for systems lacking it
+
 Changes in 3.1.0
 ================
 * NEW: AFP Spotlight support with Gnome Tracker
index 8902ae1e8da15c350c7adaca4064fa5c5dd44e4a..72c060358391743177634a309311575058bcd10c 100644 (file)
@@ -76,7 +76,7 @@ AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
 
 dnl these tests have been comfirmed to be needed in 2011
 AC_CHECK_FUNCS(backtrace_symbols dirfd getusershell pread pwrite pselect)
-AC_CHECK_FUNCS(setlinebuf strlcat strlcpy strnlen mempcpy vasprintf)
+AC_CHECK_FUNCS(setlinebuf strlcat strlcpy strnlen mempcpy vasprintf asprintf)
 AC_CHECK_FUNCS(mmap utime getpagesize) dnl needed by tbd
 
 dnl search for necessary libraries
index 32e2943dded16b60795979e39b956725d5103349..614c6f2d155ab6b04b2184262b7bea2a7b622649 100644 (file)
@@ -61,3 +61,17 @@ int vasprintf(char **ret, const char *fmt, va_list ap)
     }
 }
 #endif
+
+#ifndef HAVE_ASPRINTF
+int asprintf(char **strp, const char *fmt, ...)
+{
+    va_list ap;
+    int len;
+
+    va_start(ap, fmt);
+    len = vasprintf(strp, fmt, ap);
+    va_end(ap);
+
+    return len;
+}
+#endif