Skip to content

Commit

Permalink
Check for _NL_TIME_FIRST_WEEKDAY declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Nemo committed Oct 18, 2018
1 parent 51b07ef commit dd33b6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/Model/CalendarModel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 4 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit dd33b6a

Please sign in to comment.