From 5638e7018bc41102abed0fac059e56960c6f3d60 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 10 Oct 2024 10:06:07 +0100 Subject: [PATCH] fix macOS build --- meson.build | 6 +++--- src/imageui.c | 8 +++++--- src/tilesource.c | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index b97d9c9..9f8397c 100644 --- a/meson.build +++ b/meson.build @@ -1,10 +1,10 @@ -project( - 'vipsdisp', 'c', +project('vipsdisp', 'c', version: '3.1.0', license: 'MIT', meson_version: '>=0.56', default_options: [ - 'c_std=c11', + # glib uses this, so we do too + 'c_std=gnu11', # do a release (optimised) build by default 'buildtype=release', # turn off asserts etc. in release mode diff --git a/src/imageui.c b/src/imageui.c index f4fcc00..b10e5fa 100644 --- a/src/imageui.c +++ b/src/imageui.c @@ -157,6 +157,8 @@ imageui_set_property(GObject *object, { Imageui *imageui = (Imageui *) object; + double zoom; + #ifdef DEBUG_VERBOSE { g_autofree char *str = g_strdup_value_contents(value); @@ -179,7 +181,7 @@ imageui_set_property(GObject *object, case PROP_ZOOM: /* Scale by the zoom factor (SVG etc. zoom) we picked on load. */ - double zoom = g_value_get_double(value); + zoom = g_value_get_double(value); zoom /= imageui->tilesource->zoom; g_object_set(imageui->imagedisplay, @@ -209,6 +211,8 @@ imageui_get_property(GObject *object, { Imageui *imageui = IMAGEUI(object); + double zoom; + switch (prop_id) { case PROP_TILESOURCE: g_value_set_object(value, imageui->tilesource); @@ -220,8 +224,6 @@ imageui_get_property(GObject *object, break; case PROP_ZOOM: - double zoom; - g_object_get(imageui->imagedisplay, "zoom", &zoom, NULL); diff --git a/src/tilesource.c b/src/tilesource.c index f90e44d..e9ac937 100644 --- a/src/tilesource.c +++ b/src/tilesource.c @@ -782,6 +782,7 @@ tilesource_set_property(GObject *object, int i; double d; gboolean b; + TilesourceMode mode; #ifdef DEBUG { @@ -793,7 +794,7 @@ tilesource_set_property(GObject *object, switch (prop_id) { case PROP_MODE: - TilesourceMode mode = g_value_get_enum(value); + mode = g_value_get_enum(value); if (mode >= 0 && mode < TILESOURCE_MODE_LAST && tilesource->mode != mode) {