diff options
Diffstat (limited to 'include/ruby/missing.h')
| -rw-r--r-- | include/ruby/missing.h | 17 |
1 files changed, 10 insertions, 7 deletions
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 <time.h> +#endif #if defined(HAVE_SYS_TIME_H) -# include <sys/time.h> -#elif !defined(_WIN32) -# define time_t long +# include <sys/time.h> +#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 <sys/types.h> -#endif +#endif /* HAVE_STRUCT_TIMEVAL */ #if !defined(HAVE_STRUCT_TIMESPEC) struct timespec { |
