From 23a4f81625f2d950f8045145f22d2680b0d96b02 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 12 Jan 2010 21:54:47 +0000 Subject: [PATCH] * configure.in: check for if struct timezone is defined. * missing.h (struct timezone): define if not defined. * win32/win32.h (struct timezone): defined in the newer w32api. [ruby-core:27515] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 +++++++++ configure.in | 7 +++++++ include/ruby/missing.h | 7 +++++++ include/ruby/win32.h | 6 ++---- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd8e1367e8..3ddbe952ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Wed Jan 13 06:54:44 2010 Nobuyoshi Nakada + + * configure.in: check for if struct timezone is defined. + + * missing.h (struct timezone): define if not defined. + + * win32/win32.h (struct timezone): defined in the newer w32api. + [ruby-core:27515] + Wed Jan 13 00:33:09 2010 NARUSE, Yui * lib/shell/command-processor.rb: fix typo by Sho Hashimoto. diff --git a/configure.in b/configure.in index d2a8228265..5df7b5180d 100644 --- a/configure.in +++ b/configure.in @@ -1064,6 +1064,13 @@ AC_CHECK_TYPES([struct timespec], [], [], [@%:@ifdef HAVE_TIME_H @%:@include @%:@endif]) +AC_CHECK_TYPES([struct timezone], [], [], [@%:@ifdef HAVE_TIME_H +@%:@ include +@%:@endif +@%:@ifdef HAVE_SYS_TIME_H +@%:@ include +@%:@endif]) + AC_CHECK_TYPE(fd_mask, [AC_DEFINE(HAVE_RB_FD_INIT, 1)]) dnl RUBY_DEFINT TYPENAME, SIZE, [SIGNED-OR-UNSIGNED], [INCLUDES = DEFAULT-INCLUDES] diff --git a/include/ruby/missing.h b/include/ruby/missing.h index d553f1c738..4a90032632 100644 --- a/include/ruby/missing.h +++ b/include/ruby/missing.h @@ -38,6 +38,13 @@ struct timespec { }; #endif +#if !defined(HAVE_STRUCT_TIMEZONE) +struct timezone { + int tz_minuteswest; + int tz_dsttime; +}; +#endif + #ifndef RUBY_EXTERN #define RUBY_EXTERN extern #endif diff --git a/include/ruby/win32.h b/include/ruby/win32.h index 5f0501aa55..aa8b2c26ce 100644 --- a/include/ruby/win32.h +++ b/include/ruby/win32.h @@ -197,11 +197,9 @@ extern int rb_w32_fstat(int, struct stat *); #define strncasecmp _strnicmp #define fsync _commit +struct timezone; + #ifdef __MINGW32__ -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; #undef isascii #define isascii __isascii #endif