Author: juha Date: 2008-07-22 19:59:41 +0000 (Tue, 22 Jul 2008) New Revision: 27367
Modified: xfcalendar/trunk/configure.in.in xfcalendar/trunk/src/parameters.c Log: Fixed problem with _NL_TIME_FIRST_WEEKDAY in bsd systems, which do not have this variable defined at all. This issue was caused by fix for bug #3898. Modified: xfcalendar/trunk/configure.in.in =================================================================== --- xfcalendar/trunk/configure.in.in 2008-07-22 15:42:09 UTC (rev 27366) +++ xfcalendar/trunk/configure.in.in 2008-07-22 19:59:41 UTC (rev 27367) @@ -9,7 +9,7 @@ dnl dnl Version information -m4_define([orage_version], [4.5.14.0]) +m4_define([orage_version], [4.5.14.1-svn]) m4_define([gtk_minimum_version], [2.6.0]) m4_define([xfce_minimum_version], [4.4.0]) @@ -172,6 +172,21 @@ esac AC_SUBST([PTHREAD_LIBS]) +dnl ********************************** +dnl *** check if we have _NL_TIME_FIRST_WEEKDAY +dnl *** note that it is an enum and not a define +dnl ********************************** +AC_MSG_CHECKING([for _NL_TIME_FIRST_WEEKDAY]) +AC_TRY_LINK([#include <langinfo.h>], [ +char c; +c = *((unsigned char *) nl_langinfo(_NL_TIME_FIRST_WEEKDAY)); +], nl_ok=yes, nl_ok=no) +AC_MSG_RESULT($nl_ok) +if test "$nl_ok" = "yes"; then + AC_DEFINE([HAVE__NL_TIME_FIRST_WEEKDAY], [1], + [Define if _NL_TIME_FIRST_WEEKDAY is available]) +fi + AM_CONDITIONAL([INCLUDED_LIBICAL], [test x"$ac_INCLUDED_LIBICAL" = x"yes"]) AM_CONDITIONAL([HAVE_PTHREAD], [test x"$have_pthread" = x"yes"]) AM_CONDITIONAL([WITH_BDB4], [test x"$WITH_BDB4" = x"yes"]) Modified: xfcalendar/trunk/src/parameters.c =================================================================== --- xfcalendar/trunk/src/parameters.c 2008-07-22 15:42:09 UTC (rev 27366) +++ xfcalendar/trunk/src/parameters.c 2008-07-22 19:59:41 UTC (rev 27367) @@ -30,7 +30,10 @@ #include <stdio.h> #include <locale.h> + +#ifdef HAVE__NL_TIME_FIRST_WEEKDAY #include <langinfo.h> +#endif #include <glib.h> #include <glib/gprintf.h> @@ -129,6 +132,7 @@ * to return 0..6 mon..sun, which is what libical uses */ int get_first_weekday_from_locale() { +#ifdef HAVE__NL_TIME_FIRST_WEEKDAY union { unsigned int word; char *string; } langinfo; int week_1stday = 0; int first_weekday = 1; @@ -147,6 +151,10 @@ orage_message(150, "get_first_weekday: unknown value of _NL_TIME_WEEK_1STDAY."); return((week_1stday + first_weekday - 2 + 7) % 7); +#else + orage_message(150, "get_first_weekday: Can not find first weekday. Using default: Monday=0. If this is wrong guess. please set undocumented parameter: Ical week start day (Sunday=6)"); + return(0); +#endif } static void dialog_response(GtkWidget *dialog, gint response_id @@ -682,8 +690,9 @@ static void create_parameter_dialog_extra_setup_tab(Itf *dialog) { - GtkWidget *hbox, *vbox, *label, *event; + GtkWidget *hbox, *vbox, *label; /* code removed. relying in get_first_weekday_from_locale now + GtkWidget *event; gchar *weekday_array[7] = { _("Monday"), _("Tuesday"), _("Wednesday"), _("Thursday") , _("Friday"), _("Saturday"), _("Sunday")}; _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits