From dd33b6aa32af641d14f6514b43384eb144e8511b Mon Sep 17 00:00:00 2001 From: Cameron Nemo Date: Thu, 18 Oct 2018 11:30:28 -0700 Subject: [PATCH] Check for _NL_TIME_FIRST_WEEKDAY declaration --- core/Model/CalendarModel.vala | 4 ++++ meson.build | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/core/Model/CalendarModel.vala b/core/Model/CalendarModel.vala index 3e3b8cbd3..b33f75f84 100644 --- a/core/Model/CalendarModel.vala +++ b/core/Model/CalendarModel.vala @@ -68,7 +68,11 @@ public class Maya.Model.CalendarModel : Object { } private CalendarModel () { +#if HAVE_NL_TIME_FIRST_WEEKDAY int week_start = Posix.NLTime.FIRST_WEEKDAY.to_string ().data[0]; +#else + int week_start = 0; +#endif if (week_start >= 1 && week_start <= 7) { week_starts_on = (Maya.Settings.Weekday)week_start-1; } diff --git a/meson.build b/meson.build index 1f83be6df..3c56cbde5 100644 --- a/meson.build +++ b/meson.build @@ -38,6 +38,10 @@ if libnotify_dep.found() add_project_arguments('--define=HAVE_LIBNOTIFY', language: 'vala') endif +if cc.has_header_symbol('langinfo.h', '_NL_TIME_FIRST_WEEKDAY') + add_project_arguments('--define=HAVE_NL_TIME_FIRST_WEEKDAY', language: 'vala') +endif + gresource_calendar = gnome.compile_resources( 'gresource_calendar', 'data/maya.gresource.xml',