extern "C" {
#endif
-#ifndef _GNU_SOURCE
+#if !defined(_GNU_SOURCE) || defined(__APPLE__)
#define strchrnul util_strchrnul
static inline char *
return vsnprintf(*ret, r + 1, format, ap);
}
+#define asprintf util_asprintf
+static inline int
+util_asprintf(char **str, const char *fmt, ...)
+{
+ int ret;
+ va_list args;
+ va_start(args, fmt);
+ ret = vasprintf(str, fmt, args);
+ va_end(args);
+ return ret;
+}
+#ifndef strcasecmp
#define strcasecmp stricmp
+#endif
+
#define strdup _strdup
#endif