summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-17 13:52:45 +0000
committermichal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-17 13:52:45 +0000
commitc7e16e94e41164b9d409142a536dd80d00572dab (patch)
treeae0fe059957cddc1c37d72ae116378497a3a6a4e
parent9d298253558e899e85e4363358a30f41db95aafb (diff)
move struct timeval to missing.h
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--eval.c10
-rw-r--r--io.c11
-rw-r--r--missing.h13
-rw-r--r--process.c10
-rw-r--r--random.c10
-rw-r--r--time.c13
6 files changed, 13 insertions, 54 deletions
diff --git a/eval.c b/eval.c
index 94067fcda22..800d001ccef 100644
--- a/eval.c
+++ b/eval.c
@@ -74,16 +74,6 @@ char *strrchr _((const char*,const char));
#endif
#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#else
-#ifndef NT
-struct timeval {
- long tv_sec; /* seconds */
- long tv_usec; /* and microseconds */
-};
-#endif /* NT */
-#endif
#include <signal.h>
#include <errno.h>
diff --git a/io.c b/io.c
index 083c8e952c3..8671edeac22 100644
--- a/io.c
+++ b/io.c
@@ -60,17 +60,6 @@
# define ftello ftell
#endif
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#else
-#ifndef NT
-struct timeval {
- long tv_sec; /* seconds */
- long tv_usec; /* and microseconds */
-};
-#endif
-#endif
-
#include <sys/stat.h>
/* EMX has sys/param.h, but.. */
diff --git a/missing.h b/missing.h
index f9c9c6d0d45..44e5f86cb97 100644
--- a/missing.h
+++ b/missing.h
@@ -1,6 +1,7 @@
/************************************************
- missing.h - prototype for *.c in ./missing
+ missing.h - prototype for *.c in ./missing, and
+ for missing timeval struct
$Author$
$Date$
@@ -11,6 +12,16 @@
#ifndef MISSING_H
#define MISSING_H
+#if defined(HAVE_SYS_TIME_H)
+# include <sys/time.h>
+#elif !defined(NT)
+# define time_t long
+struct timeval {
+ time_t tv_sec; /* seconds */
+ time_t tv_usec; /* microseconds */
+};
+#endif
+
#ifndef HAVE_ACOSH
extern double acosh _((double));
extern double asinh _((double));
diff --git a/process.c b/process.c
index 9d98bc587c7..2a2f9afee24 100644
--- a/process.c
+++ b/process.c
@@ -22,16 +22,6 @@
#endif
#include <time.h>
-#ifndef NT
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#else
-struct timeval {
- long tv_sec; /* seconds */
- long tv_usec; /* and microseconds */
-};
-#endif
-#endif /* NT */
#include <ctype.h>
struct timeval rb_time_interval _((VALUE));
diff --git a/random.c b/random.c
index 547c13a0e13..4f1f5fabe8b 100644
--- a/random.c
+++ b/random.c
@@ -144,16 +144,6 @@ genrand_real()
#include <unistd.h>
#endif
#include <time.h>
-#ifndef NT
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#else
-struct timeval {
- long tv_sec; /* seconds */
- long tv_usec; /* and microseconds */
-};
-#endif
-#endif /* NT */
static int first = 1;
diff --git a/time.c b/time.c
index 01d370ed790..30b13fb674d 100644
--- a/time.c
+++ b/time.c
@@ -12,23 +12,12 @@
#include "ruby.h"
#include <sys/types.h>
-
#include <time.h>
-#ifndef NT
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#else
-#define time_t long
-struct timeval {
- time_t tv_sec; /* seconds */
- time_t tv_usec; /* and microseconds */
-};
-#endif
-#endif /* NT */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+
#include <math.h>
VALUE rb_cTime;