From 4a587fab94508271e2d6dc8370e1afe0974c7dab Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Sat, 9 Sep 2017 17:33:50 +0900 Subject: configure.in, date: move ext/date-specific existence check ext/date does not care of the type of timezone and altzone; just use have_var provided by mkmf. --- ext/date/date_core.c | 4 ++-- ext/date/extconf.rb | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'ext/date') diff --git a/ext/date/date_core.c b/ext/date/date_core.c index 6ac4ffa47e..bad86ff18b 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -7708,8 +7708,8 @@ datetime_s_now(int argc, VALUE *argv, VALUE klass) s = 59; #ifdef HAVE_STRUCT_TM_TM_GMTOFF of = tm.tm_gmtoff; -#elif defined(HAVE_VAR_TIMEZONE) -#ifdef HAVE_VAR_ALTZONE +#elif defined(HAVE_TIMEZONE) +#ifdef HAVE_ALTZONE of = (long)-((tm.tm_isdst > 0) ? altzone : timezone); #else of = (long)-timezone; diff --git a/ext/date/extconf.rb b/ext/date/extconf.rb index a4f243ee10..8938df13b3 100644 --- a/ext/date/extconf.rb +++ b/ext/date/extconf.rb @@ -1,4 +1,9 @@ # frozen_string_literal: true require 'mkmf' + config_string("strict_warnflags") {|w| $warnflags += " #{w}"} + +have_var("timezone", "time.h") +have_var("altzone", "time.h") + create_makefile('date_core') -- cgit v1.2.3