mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
ext/date/extconf.rb: check for timezone and altzone
Instead of in configure.in. As of r28592 the HAVE_VAR_TIMEZONE and HAVE_VAR_ALTZONE macros are only used by ext/date. ext/date doesn't care whether they are int or long, so just check for the existence. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
06af07dd7b
commit
e2cb0eded4
3 changed files with 7 additions and 31 deletions
|
@ -7710,8 +7710,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;
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue