From b34766f3992c7616b7816a47249fb463c053e5fa Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 8 May 2026 13:13:37 +0800 Subject: [PATCH] calendar-server: Fix build failure with libical 4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the following build error with libical 4 due to function signature changes and renames: error: passing argument 4 of 'get_time_from_property' from incompatible pointer type [-Wincompatible-pointer-types] note: expected 'ICalTime * (*)(ICalProperty *)' but argument is of type 'ICalTime * (*)(const ICalProperty *)' and error: implicit declaration of function ‘i_cal_duration_as_int’; did you mean ‘i_cal_duration_is_neg’? [-Wimplicit-function-declaration] Link: https://github.com/libical/libical/blob/4.0/docs/MigrationGuide_to_4.md Part-of: --- src/calendar-server/gnome-shell-calendar-server.c | 8 +++++++- src/calendar-server/reminder-watcher.c | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/calendar-server/gnome-shell-calendar-server.c b/src/calendar-server/gnome-shell-calendar-server.c index 969dd45156..23138fe9a5 100644 --- a/src/calendar-server/gnome-shell-calendar-server.c +++ b/src/calendar-server/gnome-shell-calendar-server.c @@ -109,11 +109,17 @@ typedef struct time_t end_time; } CalendarAppointment; +#if ICAL_CHECK_VERSION(4, 0, 0) +typedef ICalTime * (* GetICalPropFunc) (const ICalProperty *prop); +#else +typedef ICalTime * (* GetICalPropFunc) (ICalProperty *prop); +#endif + static gboolean get_time_from_property (ECalClient *cal, ICalComponent *icomp, ICalPropertyKind prop_kind, - ICalTime * (* get_prop_func) (ICalProperty *prop), + GetICalPropFunc get_prop_func, ICalTimezone *default_zone, ICalTime **out_itt, ICalTimezone **out_timezone) diff --git a/src/calendar-server/reminder-watcher.c b/src/calendar-server/reminder-watcher.c index bf39854967..074cc4f9d9 100644 --- a/src/calendar-server/reminder-watcher.c +++ b/src/calendar-server/reminder-watcher.c @@ -26,6 +26,10 @@ #include "calendar-sources.h" #include "reminder-watcher.h" +#if !ICAL_CHECK_VERSION(4, 0, 0) +#define i_cal_duration_as_utc_seconds i_cal_duration_as_int +#endif + /* Snooze for 9 minutes */ #define SNOOZE_TIME_SECS (60 * 9) @@ -283,7 +287,7 @@ reminders_process_one (ReminderWatcher *rw, case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START: case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END: - offset = i_cal_duration_as_int (e_cal_component_alarm_trigger_get_duration (trigger)); + offset = i_cal_duration_as_utc_seconds (e_cal_component_alarm_trigger_get_duration (trigger)); break; default: -- GitLab