From 72bc6c835078d744972bc1c41b645c4c2d4307b2 Mon Sep 17 00:00:00 2001 From: oetiker Date: Sun, 13 Aug 2006 16:22:53 +0000 Subject: [PATCH] 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@874 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_graph.c | 5 +---- program/src/strftime.c | 9 +++++++-- program/src/strftime.h | 2 ++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index f256dbfe..ff40f457 100644 --- a/program/src/rrd_graph.c +++ b/program/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/program/src/strftime.c b/program/src/strftime.c index 3fb860f6..c57a726f 100644 --- a/program/src/strftime.c +++ b/program/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/program/src/strftime.h b/program/src/strftime.h index 44da0ea7..c9d45e3b 100644 --- a/program/src/strftime.h +++ b/program/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 */ -- 2.30.2