From: oetiker Date: Sat, 13 Feb 2010 11:30:17 +0000 (+0000) Subject: make sure we only use _NL_TIME_WEEK_1STDAY if we actually have it ... thanks kevin... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4b18df3a8f0e0b16875333cfd9960fc6949f285b;p=rrdtool-all.git make sure we only use _NL_TIME_WEEK_1STDAY if we actually have it ... thanks kevin for the report git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@2020 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/configure.ac b/program/configure.ac index 07231b79..d18fe9ec 100644 --- a/program/configure.ac +++ b/program/configure.ac @@ -345,6 +345,12 @@ CONFIGURE_PART(Resolve Portability Issues) CHECK_FOR_WORKING_MS_ASYNC +dnl do we have nl_langinfo(_NL_TIME_WEEK_1STDAY) +AC_CHECK_FUNCS(_NL_TIME_WEEK_1STDAY, , + [AC_MSG_CHECKING([for nl_langinfo(_NL_TIME_WEEK_1STDAY) with langinfo.h]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[nl_langinfo(_NL_TIME_WEEK_1STDAY)]])],[AC_MSG_RESULT(yes) + AC_DEFINE(HAVE__NL_TIME_WEEK_1STDAY)],[AC_MSG_RESULT(no)])]) + dnl Do we need getopt_long dnl even when including our own getopt implementation diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index 390a66ec..9e23a4af 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -1359,11 +1359,10 @@ int data_proc( return 0; } - static int find_first_weekday(void){ static int first_weekday = -1; if (first_weekday == -1){ -#if defined(HAVE_NL_LANGINFO) +#ifdef HAVE__NL_TIME_WEEK_1STDAY /* according to http://sourceware.org/ml/libc-locales/2009-q1/msg00011.html */ long week_1stday_l = (long) nl_langinfo (_NL_TIME_WEEK_1STDAY); if (week_1stday_l == 19971130) first_weekday = 0; /* Sun */