diff options
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | configure.in | 7 | ||||
-rw-r--r-- | ext/date/date_strftime.c | 4 | ||||
-rw-r--r-- | file.c | 4 | ||||
-rw-r--r-- | include/ruby/missing.h | 12 | ||||
-rw-r--r-- | random.c | 3 | ||||
-rw-r--r-- | thread_pthread.c | 3 | ||||
-rw-r--r-- | time.c | 4 | ||||
-rw-r--r-- | version.h | 2 |
9 files changed, 51 insertions, 4 deletions
@@ -1,3 +1,19 @@ +Wed Mar 20 22:33:26 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com> + + * include/ruby/missing.h (struct timespec): include <sys/time.h> + +Wed Mar 20 22:33:26 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com> + + * 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. + Mon Mar 18 00:12:28 2013 Eric Hodel <drbrain@segment7.net> * lib/rubygems/commands/setup_command.rb: Don't delete non-rubygems diff --git a/configure.in b/configure.in index 93a13e80ce..cf53e019c1 100644 --- a/configure.in +++ b/configure.in @@ -1371,6 +1371,13 @@ AC_CHECK_MEMBERS([struct stat.st_ctim]) AC_CHECK_MEMBERS([struct stat.st_ctimespec]) AC_CHECK_MEMBERS([struct stat.st_ctimensec]) +AC_CHECK_TYPES([struct timeval], [], [], [@%:@ifdef HAVE_TIME_H +@%:@include <time.h> +@%:@endif +@%:@ifdef HAVE_SYS_TIME_H +@%:@include <sys/time.h> +@%:@endif]) + AC_CHECK_TYPES([struct timespec], [], [], [@%:@ifdef HAVE_TIME_H @%:@include <time.h> @%:@endif diff --git a/ext/date/date_strftime.c b/ext/date/date_strftime.c index 54324dad09..20931a3124 100644 --- a/ext/date/date_strftime.c +++ b/ext/date/date_strftime.c @@ -12,6 +12,10 @@ #include <ctype.h> #include <errno.h> +#if defined(HAVE_SYS_TIME_H) +#include <sys/time.h> +#endif + #undef strchr /* avoid AIX weirdness */ #define range(low, item, hi) (item) @@ -75,6 +75,10 @@ int flock(int, int); #include <fcntl.h> #endif +#if defined(HAVE_SYS_TIME_H) +#include <sys/time.h> +#endif + #if !defined HAVE_LSTAT && !defined lstat #define lstat stat #endif diff --git a/include/ruby/missing.h b/include/ruby/missing.h index 1297c43a7a..616e699ad5 100644 --- a/include/ruby/missing.h +++ b/include/ruby/missing.h @@ -25,20 +25,26 @@ extern "C" { #include RUBY_EXTCONF_H #endif -#if defined(HAVE_SYS_TIME_H) +#if !defined(HAVE_STRUCT_TIMEVAL) +# if defined(HAVE_SYS_TIME_H) # include <sys/time.h> -#elif !defined(_WIN32) +# elif !defined(_WIN32) # define time_t long struct timeval { time_t tv_sec; /* seconds */ long tv_usec; /* microseconds */ }; -#endif +# endif +#endif /* HAVE_STRUCT_TIMEVAL */ + #if defined(HAVE_SYS_TYPES_H) # include <sys/types.h> #endif #if !defined(HAVE_STRUCT_TIMESPEC) +# if defined(HAVE_SYS_TIME_H) +# include <sys/time.h> +# endif struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ @@ -73,6 +73,9 @@ The original copyright notice follows. #endif #include <math.h> #include <errno.h> +#if defined(HAVE_SYS_TIME_H) +#include <sys/time.h> +#endif #ifdef _WIN32 # if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0400 diff --git a/thread_pthread.c b/thread_pthread.c index 37a1e4740e..e2945d8662 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -33,6 +33,9 @@ #if HAVE_POLL #include <poll.h> #endif +#if defined(HAVE_SYS_TIME_H) +#include <sys/time.h> +#endif static void native_mutex_lock(pthread_mutex_t *lock); static void native_mutex_unlock(pthread_mutex_t *lock); @@ -27,6 +27,10 @@ #include <strings.h> #endif +#if defined(HAVE_SYS_TIME_H) +#include <sys/time.h> +#endif + #include "timev.h" static ID id_divmod, id_mul, id_submicro, id_nano_num, id_nano_den, id_offset, id_zone; @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.0.0" #define RUBY_RELEASE_DATE "2013-03-20" -#define RUBY_PATCHLEVEL 73 +#define RUBY_PATCHLEVEL 74 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 3 |