aboutsummaryrefslogtreecommitdiffstats
path: root/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'time.c')
-rw-r--r--time.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/time.c b/time.c
index 4d0d723..9d3be9a 100644
--- a/time.c
+++ b/time.c
@@ -1,18 +1,18 @@
/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*
* As a special exception, the Free Software Foundation gives permission
* for additional uses of the text contained in its release of GUILE.
@@ -36,7 +36,7 @@
*
* If you write modifications of your own for GUILE, it is your choice
* whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice.
+ * If you do not wish that, delete this exception notice.
*/
/* "time.c" functions dealing with time.
@@ -103,7 +103,7 @@
# include <sys/timeb.h>
# define USE_GETTIMEOFDAY
#endif
-#ifdef freebsd
+#ifdef __FreeBSD__
# include <sys/types.h>
# include <sys/time.h>
# include <sys/timeb.h>
@@ -160,6 +160,12 @@
#ifdef _UNICOS
# define LACK_FTIME
#endif
+#ifdef __amigados__
+# include <sys/time.h>
+# include <sys/timeb.h>
+# include <sys/times.h>
+# define USE_GETTIMEOFDAY
+#endif
#ifndef LACK_FTIME
# ifdef unix
@@ -329,14 +335,11 @@ SCM your_time()
else if ((1 + time_buffer1.time)==time_buffer2.time) ;
else if (cnt < TIMETRIES) goto tryagain;
else {
- warn("could not read two ftime()s within one second in 10 tries",0L);
+ scm_warn("could not read two ftime()s within one second in 10 tries",0L);
return MAKINUM(-1);
}
- time_buffer2.time -= your_base.time;
- tmp = time_buffer2.millitm - your_base.millitm;
- tmp = time_buffer2.time*1000L + tmp;
- tmp *= CLKTCK;
- tmp /= 1000;
+ tmp = CLKTCK*(time_buffer2.millitm - your_base.millitm);
+ tmp = CLKTCK*(time_buffer2.time - your_base.time) + tmp/1000;
return MAKINUM(tmp);
}
#endif /* LACK_FTIME */