summaryrefslogtreecommitdiffstats
path: root/smbclient-upstream.patch
diff options
context:
space:
mode:
Diffstat (limited to 'smbclient-upstream.patch')
-rw-r--r--smbclient-upstream.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/smbclient-upstream.patch b/smbclient-upstream.patch
new file mode 100644
index 0000000..5799287
--- /dev/null
+++ b/smbclient-upstream.patch
@@ -0,0 +1,66 @@
+From 9ff3c987291dba1e4904672a9ca22e9b38739384 Mon Sep 17 00:00:00 2001
+From: Po-Chuan Hsieh <sunpoet@sunpoet.net>
+Date: Wed, 6 Sep 2023 00:46:57 +0800
+Subject: [PATCH] Fix build warning on i386
+
+/wrkdirs/usr/ports/net/pecl-smbclient/work-php81/smbclient-1.1.1/smbclient.c:1205:52: warning: format specifies type 'long' but the argument has type 'zend_long' (aka 'int') [-Wformat]
+ php_error(E_WARNING, "Negative byte count: %ld", count);
+ ~~~ ^~~~~
+ %d
+/wrkdirs/usr/ports/net/pecl-smbclient/work-php81/smbclient-1.1.1/smbclient.c:1256:52: warning: format specifies type 'long' but the argument has type 'zend_long' (aka 'int') [-Wformat]
+ php_error(E_WARNING, "Negative byte count: %ld", count);
+ ~~~ ^~~~~
+ %d
+2 warnings generated.
+---
+ smbclient.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/smbclient.c b/smbclient.c
+index ad1f3d8..8a24dab 100644
+--- a/smbclient.c
++++ b/smbclient.c
+@@ -1202,7 +1202,7 @@ PHP_FUNCTION(smbclient_read)
+ return;
+ }
+ if (count < 0) {
+- php_error(E_WARNING, "Negative byte count: %ld", count);
++ php_error(E_WARNING, "Negative byte count: " ZEND_LONG_FMT, count);
+ RETURN_FALSE;
+ }
+ STATE_FROM_ZSTATE;
+@@ -1253,7 +1253,7 @@ PHP_FUNCTION(smbclient_write)
+ return;
+ }
+ if (count < 0) {
+- php_error(E_WARNING, "Negative byte count: %ld", count);
++ php_error(E_WARNING, "Negative byte count: " ZEND_LONG_FMT, count);
+ RETURN_FALSE;
+ }
+ if (count == 0 || count > str_len) {
+From 43f9e8e3ee234e51390adbcc8f42ab0271930702 Mon Sep 17 00:00:00 2001
+From: Po-Chuan Hsieh <sunpoet@sunpoet.net>
+Date: Wed, 6 Sep 2023 00:45:40 +0800
+Subject: [PATCH] Fix build with Clang 16 on i386
+
+/wrkdirs/usr/ports/net/pecl-smbclient/work-php80/smbclient-1.1.1/smb_streams.c:328:2: error: incompatible function pointer types initializing 'int (*)(php_stream *, zend_off_t, int, zend_off_t *)' (aka 'int (*)(struct _php_stream *, int, int, int *)') with an expression of type 'int (php_stream *, off_t, int, off_t *)' (aka 'int (struct _php_stream *, long long, int, long long *)') [-Wincompatible-function-pointer-types]
+ php_smb_ops_seek,
+ ^~~~~~~~~~~~~~~~
+1 error generated.
+---
+ smb_streams.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/smb_streams.c b/smb_streams.c
+index 8b2a9ab..51a0a32 100644
+--- a/smb_streams.c
++++ b/smb_streams.c
+@@ -270,7 +270,7 @@ static int php_smb_ops_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_D
+ return 0;
+ }
+
+-static int php_smb_ops_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC)
++static int php_smb_ops_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC)
+ {
+ STREAM_DATA_FROM_STREAM();
+