SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

View file

@ -0,0 +1,30 @@
Implement (read-only) fmemopen() which is only found in GLIBC.
--- xsvftool-xpcu.src/xsvftool-xpcu.c.orig Thu Aug 25 10:35:19 2011
+++ xsvftool-xpcu.src/xsvftool-xpcu.c Thu Aug 25 10:36:49 2011
@@ -542,6 +542,25 @@ static void help()
exit(1);
}
+#ifndef fmemopen
+#include <assert.h>
+
+FILE *fmemopen (void *, size_t, const char *);
+
+FILE *fmemopen (void *buf, size_t size, const char *opentype)
+{
+ FILE *f;
+
+ assert(strcmp(opentype, "r") == 0);
+
+ f = tmpfile();
+ fwrite(buf, 1, size, f);
+ rewind(f);
+
+ return f;
+}
+#endif
+
int main(int argc, char **argv)
{
int rc = 0;