From: oetiker Date: Sun, 13 Aug 2006 16:22:53 +0000 (+0000) Subject: use th OS provided timezone names for %Z this should make things more flexile X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b87b81a11a4763a1744adbd8f2dc97d58e4aa161;p=rrdtool.git use th OS provided timezone names for %Z this should make things more flexile 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 --- diff --git a/src/rrd_graph.c b/src/rrd_graph.c index f256dbf..ff40f45 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -7,13 +7,10 @@ #include -#ifdef WIN32 -#include "strftime.h" -#endif - #include "rrd_tool.h" #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#include "strftime.h" #include #include #endif diff --git a/src/strftime.c b/src/strftime.c index 3fb860f..c57a726 100644 --- a/src/strftime.c +++ b/src/strftime.c @@ -17,6 +17,13 @@ #include /* 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, ...); diff --git a/src/strftime.h b/src/strftime.h index 44da0ea..c9d45e3 100644 --- a/src/strftime.h +++ b/src/strftime.h @@ -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 */