diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-30 21:08:42 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-30 21:08:42 +0000 |
commit | b5583577d46e8aa1725840186e0f609cacec1bda (patch) | |
tree | 5d89a37803a6541376bfb34cea311ca6f2216708 /configure.in | |
parent | 77ff241fa0bc5f9db2606486f486a3de39f70718 (diff) | |
download | ruby-b5583577d46e8aa1725840186e0f609cacec1bda.tar.gz |
thread.c: TYPEOF_TIMEVAL_TV_SEC
* configure.in (TYPEOF_TIMEVAL_TV_SEC): check for x64-mingw, where
timeval.tv_sec is not time_t.
* thread.c (double2timeval): use TYPEOF_TIMEVAL_TV_SEC to get rid of
overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.in b/configure.in index baa77f371f..1d3f328ee8 100644 --- a/configure.in +++ b/configure.in @@ -1461,6 +1461,24 @@ AC_CHECK_TYPES([struct timeval], [], [], [@%:@ifdef HAVE_TIME_H @%:@include <sys/time.h> @%:@endif]) +if test "${ac_cv_type_struct_timeval}" = yes; then + RUBY_CHECK_SIZEOF([struct timeval.tv_sec], [time_t long "long long"], [], + [@%:@ifdef HAVE_TIME_H +@%:@include <time.h> +@%:@endif +@%:@ifdef HAVE_SYS_TIME_H +@%:@include <sys/time.h> +@%:@endif]) + AS_CASE(${ac_cv_sizeof_struct_timeval_tv_sec}, + [SIZEOF_INT], [t=int], + [SIZEOF_LONG], [t=long], + [SIZEOF_LONG_LONG], [t=LONG_LONG], + [t=]) + if test "${t}" != ""; then + AC_DEFINE_UNQUOTED(TYPEOF_TIMEVAL_TV_SEC, [$t]) + fi +fi + AC_CHECK_TYPES([struct timespec], [], [], [@%:@ifdef HAVE_TIME_H @%:@include <time.h> @%:@endif |