From b97e925571e32dff40573af7991d7dfe7fc9c7ce Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 28 Mar 2013 10:10:00 +0000 Subject: merge revision(s) 39772,39773,39774,39775,39777,39779,39781,39783: [Backport #8080] * configure.in: check struct timeval exist or not. * include/ruby/missing.h (struct timeval): check HAVE_STRUCT_TIMEVAL properly. and don't include sys/time.h if struct timeval exist. * file.c: include sys/time.h explicitly. * random.c: ditto. * thread_pthread.c: ditto. * time.c: ditto. * ext/date/date_strftime.c: ditto. * include/ruby/missing.h (struct timespec): include * include/ruby/missing.h (__syscall): moved to... * io.c: here. because __syscall() is only used from io.c. * include/ruby/missing.h: move "#include " to .... * include/ruby/intern.h: here. because it was introduced for fixing NFDBITS issue. [ruby-core:05179]. * thread.c: disabled _FORTIFY_SOURCE for avoid to hit glibc bug. [Bug #8080] [ruby-core:53349] * test/ruby/test_io.rb (TestIO#test_io_select_with_many_files): test for the above. * include/ruby/missing.h: removed __linux__. it's unnecessary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/intern.h | 5 +++++ include/ruby/missing.h | 17 ++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'include/ruby') diff --git a/include/ruby/intern.h b/include/ruby/intern.h index 9745afdfda..6e1c2c2d90 100644 --- a/include/ruby/intern.h +++ b/include/ruby/intern.h @@ -31,6 +31,11 @@ extern "C" { #else # include #endif + +#if defined(HAVE_SYS_TYPES_H) +#include +#endif + #include "ruby/st.h" #if defined __GNUC__ && __GNUC__ >= 4 diff --git a/include/ruby/missing.h b/include/ruby/missing.h index bded5521d1..d2cacd2706 100644 --- a/include/ruby/missing.h +++ b/include/ruby/missing.h @@ -24,18 +24,21 @@ extern "C" { #include RUBY_EXTCONF_H #endif +#if !defined(HAVE_STRUCT_TIMEVAL) || !defined(HAVE_STRUCT_TIMESPEC) +#if defined(HAVE_TIME_H) +# include +#endif #if defined(HAVE_SYS_TIME_H) -# include -#elif !defined(_WIN32) -# define time_t long +# include +#endif +#endif + +#if !defined(HAVE_STRUCT_TIMEVAL) struct timeval { time_t tv_sec; /* seconds */ long tv_usec; /* microseconds */ }; -#endif -#if defined(HAVE_SYS_TYPES_H) -# include -#endif +#endif /* HAVE_STRUCT_TIMEVAL */ #if !defined(HAVE_STRUCT_TIMESPEC) struct timespec { -- cgit v1.2.3