Code

make sure we only use _NL_TIME_WEEK_1STDAY if we actually have it ... thanks kevin...
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sat, 13 Feb 2010 11:30:17 +0000 (11:30 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sat, 13 Feb 2010 11:30:17 +0000 (11:30 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@2020 a5681a0c-68f1-0310-ab6d-d61299d08faa

configure.ac
src/rrd_graph.c

index 07231b79dfa159555c2796de735634711732f8d9..d18fe9ecbb6d9d6e1094602a2076a3b13eac49ac 100644 (file)
@@ -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 <langinfo.h>]], [[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
index 390a66ec162ebe8ee80c48cf3932a62bf5eab7ed..9e23a4af06efa10ec652a8643cc0528c80211196 100644 (file)
@@ -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 */