From ceeae31901275c9a3fde19aa05b343fbcf6187d1 Mon Sep 17 00:00:00 2001 From: Rei Odaira Date: Sat, 2 Oct 2021 21:22:37 -0500 Subject: [PATCH] Avoid using the altzone variable in AIX In AIX, altzone exists in the standard library but is not declared in time.h. By 524513be399e81bb170ec88aa0d501f33cbde8c3, have_var and try_var in mkmf recognizes a variable that exists in a library even when it is not declared. As a result, in AIX, HAVE_ALTZONE is defined, but compile fails due to the lack of the declaration. --- ext/date/date_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/date/date_core.c b/ext/date/date_core.c index 4a2225fd2c..146f60fef6 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -7797,7 +7797,7 @@ datetime_s_now(int argc, VALUE *argv, VALUE klass) #ifdef HAVE_STRUCT_TM_TM_GMTOFF of = tm.tm_gmtoff; #elif defined(HAVE_TIMEZONE) -#ifdef HAVE_ALTZONE +#if defined(HAVE_ALTZONE) && !defined(_AIX) of = (long)-((tm.tm_isdst > 0) ? altzone : timezone); #else of = (long)-timezone;