summaryrefslogtreecommitdiffstats
path: root/strftime.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-12 00:46:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-12 00:46:59 +0000
commitcf288d2552d5afef200bee4109ce00a7e32d0ae7 (patch)
treec6a96350655adece8a4b0f31f27ad871fe11c1b2 /strftime.c
parente6df23cf05dbb2b18d39a8ebe7a463259fcde5fc (diff)
downloadruby-cf288d2552d5afef200bee4109ce00a7e32d0ae7.tar.gz
ruby-cf288d2552d5afef200bee4109ce00a7e32d0ae7.tar.xz
ruby-cf288d2552d5afef200bee4109ce00a7e32d0ae7.zip
* strftime.c (rb_strftime): suppressed warnings on cygwin.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'strftime.c')
-rw-r--r--strftime.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/strftime.c b/strftime.c
index b88b9ef40..af66fa637 100644
--- a/strftime.c
+++ b/strftime.c
@@ -195,12 +195,11 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
#endif /* POSIX_SEMANTICS */
#ifndef HAVE_TM_ZONE
#ifndef HAVE_TM_NAME
-#if !defined HAVE_VAR_TIMEZONE || defined HAVE_TIMEZONE
+#if ((defined(MAILHEADER_EXT) && !HAVE_VAR_TIMEZONE && HAVE_GETTIMEOFDAY) || \
+ (!HAVE_TZNAME && HAVE_TIMEZONE))
struct timeval tv;
-#endif
-#ifdef HAVE_TIMEZONE
struct timezone zone;
-#endif /* HAVE_TIMEZONE */
+#endif
#endif /* HAVE_TM_NAME */
#endif /* HAVE_TM_ZONE */
int precision, flags;
@@ -473,7 +472,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
#else
off = -timezone / 60;
#endif
-#else /* !HAVE_TIMEZONE */
+#else /* !HAVE_VAR_TIMEZONE */
#ifdef HAVE_GETTIMEOFDAY
gettimeofday(&tv, &zone);
off = -zone.tz_minuteswest;
@@ -487,7 +486,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
off = (now - mktime(&utc)) / 60;
}
#endif
-#endif /* !HAVE_TIMEZONE */
+#endif /* !HAVE_VAR_TIMEZONE */
#endif /* !HAVE_TM_ZONE */
#endif /* !HAVE_TM_NAME */
}