[geary/mjog/gmime-stream-write-api-break: 2/2] engine: Work around VAPI binding change causing GMime API break
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/gmime-stream-write-api-break: 2/2] engine: Work around VAPI binding change causing GMime API break
- Date: Tue, 20 Apr 2021 23:13:12 +0000 (UTC)
commit 1f3e4decd387deffb29220cb1ed6acba94d9c2b8
Author: Michael Gratton <mike vee net>
Date: Wed Apr 21 09:11:59 2021 +1000
engine: Work around VAPI binding change causing GMime API break
See https://github.com/jstedfast/gmime/pull/101
src/engine/util/util-stream.vala | 13 +++++++++++++
src/meson.build | 4 ++++
2 files changed, 17 insertions(+)
---
diff --git a/src/engine/util/util-stream.vala b/src/engine/util/util-stream.vala
index 18df50fb3..1eeef49ca 100644
--- a/src/engine/util/util-stream.vala
+++ b/src/engine/util/util-stream.vala
@@ -60,6 +60,7 @@ namespace Geary.Stream {
return this.written;
}
+#if GMIME_STREAM_WRITE_STRING
public override ssize_t write(string buf, size_t len) {
ssize_t ret = -1;
try {
@@ -70,6 +71,18 @@ namespace Geary.Stream {
}
return ret;
}
+#else
+ public override ssize_t write(uint8[] buf) {
+ ssize_t ret = -1;
+ try {
+ ret = this.dest.write(buf);
+ this.written += buf.length;
+ } catch (IOError err) {
+ // Oh well
+ }
+ return ret;
+ }
+#endif
public override int close() {
int ret = -1;
diff --git a/src/meson.build b/src/meson.build
index 07f2158f6..5eded12e6 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -39,6 +39,10 @@ if get_option('ref_tracking').enabled()
vala_defines += [ '--define=REF_TRACKING' ]
endif
+if gmime.version().version_compare('<=3.2.7')
+ vala_defines += [ '--define=GMIME_STREAM_WRITE_STRING' ]
+endif
+
geary_vala_args += vala_defines
# Common cc options
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]