|
@@ -1,32 +1,37 @@
|
|
|
+From a1f3bf3c98d21b09a75f57682cdb12a6e48ebb08 Mon Sep 17 00:00:00 2001
|
|
|
+From: Julianiolo <[email protected]>
|
|
|
+Date: Fri, 13 Sep 2024 21:31:02 +0200
|
|
|
+Subject: [PATCH] replace ssize_t with gint64
|
|
|
+
|
|
|
+---
|
|
|
+ libvips/iofuncs/generate.c | 2 +-
|
|
|
+ libvips/iofuncs/util.c | 2 +-
|
|
|
+ 2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
+
|
|
|
diff --git a/libvips/iofuncs/generate.c b/libvips/iofuncs/generate.c
|
|
|
-index bb3d1b2d7..8be7ad675 100644
|
|
|
+index bb3d1b2d7..8941762f7 100644
|
|
|
--- a/libvips/iofuncs/generate.c
|
|
|
+++ b/libvips/iofuncs/generate.c
|
|
|
-@@ -92,6 +92,11 @@
|
|
|
- #endif /*HAVE_CONFIG_H*/
|
|
|
- #include <glib/gi18n-lib.h>
|
|
|
+@@ -638,7 +638,7 @@ write_vips(VipsRegion *region, VipsRect *area, void *a)
|
|
|
+ // write() uses int not size_t on windows, so we need to chunk
|
|
|
+ // ... max 1gb, why not
|
|
|
+ int chunk_size = VIPS_MIN(1024 * 1024 * 1024, count);
|
|
|
+- ssize_t nwritten = write(region->im->fd, buf, chunk_size);
|
|
|
++ gint64 nwritten = write(region->im->fd, buf, chunk_size);
|
|
|
|
|
|
-+#if defined(_MSC_VER)
|
|
|
-+#include <BaseTsd.h>
|
|
|
-+typedef SSIZE_T ssize_t;
|
|
|
-+#endif
|
|
|
-+
|
|
|
- #include <stdio.h>
|
|
|
- #include <stdlib.h>
|
|
|
- #include <stdarg.h>
|
|
|
+ /* n == 0 isn't strictly an error, but we treat it as
|
|
|
+ * one to make sure we don't get stuck in this loop.
|
|
|
diff --git a/libvips/iofuncs/util.c b/libvips/iofuncs/util.c
|
|
|
-index 047516084..c2049c107 100644
|
|
|
+index 46976ef42..acf78ade8 100644
|
|
|
--- a/libvips/iofuncs/util.c
|
|
|
+++ b/libvips/iofuncs/util.c
|
|
|
-@@ -37,6 +37,11 @@
|
|
|
- #endif /*HAVE_CONFIG_H*/
|
|
|
- #include <glib/gi18n-lib.h>
|
|
|
+@@ -468,7 +468,7 @@ vips__write(int fd, const void *buf, size_t count)
|
|
|
+ // write() uses int not size_t on windows, so we need to chunk
|
|
|
+ // ... max 1gb, why not
|
|
|
+ int chunk_size = VIPS_MIN(1024 * 1024 * 1024, count);
|
|
|
+- ssize_t nwritten = write(fd, buf, chunk_size);
|
|
|
++ gint64 nwritten = write(fd, buf, chunk_size);
|
|
|
+
|
|
|
+ /* n == 0 isn't strictly an error, but we treat it as
|
|
|
+ * one to make sure we don't get stuck in this loop.
|
|
|
|
|
|
-+#if defined(_MSC_VER)
|
|
|
-+#include <BaseTsd.h>
|
|
|
-+typedef SSIZE_T ssize_t;
|
|
|
-+#endif
|
|
|
-+
|
|
|
- #include <stdio.h>
|
|
|
- #include <stdlib.h>
|
|
|
- #include <string.h>
|