use th OS provided timezone names for %Z this should make things more flexile
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sun, 13 Aug 2006 16:22:53 +0000 (16:22 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sun, 13 Aug 2006 16:22:53 +0000 (16:22 +0000)
will only work on windows, but since we are using strftime.c on windows only this should not be a problem -- Guenter Knauf

git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@874 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd_graph.c
src/strftime.c
src/strftime.h

index f256dbf..ff40f45 100644 (file)
@@ -7,13 +7,10 @@
 
 #include <sys/stat.h>
 
-#ifdef WIN32
-#include "strftime.h"
-#endif
-
 #include "rrd_tool.h"
 
 #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+#include "strftime.h"
 #include <io.h>
 #include <fcntl.h>
 #endif
index 3fb860f..c57a726 100644 (file)
 #include <time.h>       /* for struct tm */
 #include "strftime.h"
 
+/* Define your own defaults in config.h if necessary */
+#if defined(TZNAME_STD) && defined(TZNAME_DST)
+char *tzname_[2] = {TZNAME_STD, TZNAME_DST};
+#else
+#define tzname_ tzname
+#endif
+
 static char *aday[] = {
     "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
 };
@@ -36,8 +43,6 @@ static char *month[] = {
     "July", "August", "September", "October", "November", "December"
 };
 
-char *tzname_[2] = {"CST", "CDT"};        /* Add your own defaults here */
-
 static char buf[26];
 
 static void strfmt(char *str, const char *fmt, ...);
index 44da0ea..c9d45e3 100644 (file)
@@ -13,6 +13,8 @@
 
 size_t strftime_(char *s, size_t maxs, const char *f, const struct tm *t);
 
+#if defined(TZNAME_STD) && defined(TZNAME_DST)
 extern char * tzname_[2];
+#endif
 
 #endif /* STRFTIME__H */