void-packages/srcpkgs/okular/patches/musl-vasprintf.patch

30 lines
641 B
Diff

--- core/synctex/synctex_parser.c 2017-12-05 23:07:10.000000000 +0100
+++ core/synctex/synctex_parser.c 2018-01-01 19:03:46.281593488 +0100
@@ -8188,6 +8188,26 @@
}
#endif
+#if !defined(__GLIBC__)
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+static int vasprintf(char **ret,
+ const char *format,
+ va_list ap)
+{
+ int len;
+ len = vsnprintf(NULL, 0, format, ap);
+ if (len < 0) return -1;
+ *ret = malloc(len + 1);
+ if (!*ret) return -1;
+ vsnprintf(*ret, len+1, format, ap);
+ (*ret)[len] = '\0';
+ return len;
+}
+
+#endif
/**
* gzvprintf is not available until OSX 10.10