-
-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30c4b7b
commit 6c78b34
Showing
2 changed files
with
30 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters