1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 13:30:26 +02:00

* stime.c (scm_init_stime): don't define ticks/sec.

(scm_gettimeofday): renamed from scm_time_plus_ticks (avoids multiple
return value problem and is still portable.)
This commit is contained in:
Gary Houston 1997-04-06 00:00:10 +00:00
parent 5c09c7ea2d
commit 1bf9865d26
3 changed files with 12 additions and 18 deletions

View file

@ -1,3 +1,9 @@
Sat Apr 5 23:56:40 1997 Gary Houston <ghouston@actrix.gen.nz>
* stime.c (scm_init_stime): don't define ticks/sec.
(scm_gettimeofday): renamed from scm_time_plus_ticks (avoids multiple
return value problem and is still portable.)
Sat Apr 5 17:59:24 1997 Jim Blandy <jimb@floss.cyclic.com>
* cpp_err_symbols.in: Renamed from cpp_err_symbols, to avoid

View file

@ -183,16 +183,16 @@ scm_current_time()
return scm_long2num((long) timv);
}
SCM_PROC (s_time_plus_ticks, "time+ticks", 0, 0, 0, scm_time_plus_ticks);
SCM_PROC (s_gettimeofday, "gettimeofday", 0, 0, 0, scm_gettimeofday);
SCM
scm_time_plus_ticks (void)
scm_gettimeofday (void)
{
#ifdef HAVE_GETTIMEOFDAY
struct timeval time;
SCM_DEFER_INTS;
if (gettimeofday (&time, NULL) == -1)
scm_syserror (s_time_plus_ticks);
scm_syserror (s_gettimeofday);
SCM_ALLOW_INTS;
return scm_cons (scm_long2num ((long) time.tv_sec),
scm_long2num ((long) time.tv_usec));
@ -202,13 +202,13 @@ scm_time_plus_ticks (void)
ftime(&time);
return scm_cons (scm_long2num ((long) time.time),
SCM_MAKINUM (time.millitm));
SCM_MAKINUM (time.millitm) * 1000);
# else
timet timv;
SCM_DEFER_INTS;
if ((timv = time (0)) == -1)
scm_syserror (s_time_plus_ticks);
scm_syserror (s_gettimeofday);
SCM_ALLOW_INTS;
return scm_cons (scm_long2num (timv), SCM_MAKINUM (0));
# endif
@ -405,18 +405,6 @@ scm_init_stime()
if (!scm_your_base) time(&scm_your_base);
#endif
scm_sysintern("ticks/sec",
#ifdef HAVE_GETTIMEOFDAY
scm_long2num ((long) 1000000)
#else
# ifdef HAVE_FTIME
SCM_MAKINUM (1000)
# else
SCM_MAKINUM (1)
# endif
#endif
);
if (!scm_my_base) scm_my_base = mytime();
scm_add_feature ("current-time");

View file

@ -50,7 +50,7 @@
extern SCM scm_get_internal_real_time SCM_P ((void));
extern SCM scm_get_internal_run_time SCM_P ((void));
extern SCM scm_current_time SCM_P ((void));
extern SCM scm_time_plus_ticks (void);
extern SCM scm_gettimeofday (void);
extern SCM scm_localtime (SCM time, SCM zone);
extern SCM scm_gmtime (SCM time);
extern SCM scm_mktime (SCM sbd_time);