summaryrefslogtreecommitdiff
path: root/include/ruby/missing.h
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-16 05:06:47 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-16 05:06:47 +0000
commit798ff850e41752834bd27081c2e85f874b2cc4aa (patch)
treee5973b474b584da190596376552d81888515cbd4 /include/ruby/missing.h
parent2e544471ae719757a0fec2a686bdeb7a97540c90 (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/missing.h')
-rw-r--r--include/ruby/missing.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/ruby/missing.h b/include/ruby/missing.h
index 1297c43a7a6..4a19cc78472 100644
--- a/include/ruby/missing.h
+++ b/include/ruby/missing.h
@@ -25,15 +25,18 @@ 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