mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 05:50: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:
parent
5c09c7ea2d
commit
1bf9865d26
3 changed files with 12 additions and 18 deletions
|
@ -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>
|
Sat Apr 5 17:59:24 1997 Jim Blandy <jimb@floss.cyclic.com>
|
||||||
|
|
||||||
* cpp_err_symbols.in: Renamed from cpp_err_symbols, to avoid
|
* cpp_err_symbols.in: Renamed from cpp_err_symbols, to avoid
|
||||||
|
|
|
@ -183,16 +183,16 @@ scm_current_time()
|
||||||
return scm_long2num((long) timv);
|
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
|
||||||
scm_time_plus_ticks (void)
|
scm_gettimeofday (void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_GETTIMEOFDAY
|
#ifdef HAVE_GETTIMEOFDAY
|
||||||
struct timeval time;
|
struct timeval time;
|
||||||
|
|
||||||
SCM_DEFER_INTS;
|
SCM_DEFER_INTS;
|
||||||
if (gettimeofday (&time, NULL) == -1)
|
if (gettimeofday (&time, NULL) == -1)
|
||||||
scm_syserror (s_time_plus_ticks);
|
scm_syserror (s_gettimeofday);
|
||||||
SCM_ALLOW_INTS;
|
SCM_ALLOW_INTS;
|
||||||
return scm_cons (scm_long2num ((long) time.tv_sec),
|
return scm_cons (scm_long2num ((long) time.tv_sec),
|
||||||
scm_long2num ((long) time.tv_usec));
|
scm_long2num ((long) time.tv_usec));
|
||||||
|
@ -202,13 +202,13 @@ scm_time_plus_ticks (void)
|
||||||
|
|
||||||
ftime(&time);
|
ftime(&time);
|
||||||
return scm_cons (scm_long2num ((long) time.time),
|
return scm_cons (scm_long2num ((long) time.time),
|
||||||
SCM_MAKINUM (time.millitm));
|
SCM_MAKINUM (time.millitm) * 1000);
|
||||||
# else
|
# else
|
||||||
timet timv;
|
timet timv;
|
||||||
|
|
||||||
SCM_DEFER_INTS;
|
SCM_DEFER_INTS;
|
||||||
if ((timv = time (0)) == -1)
|
if ((timv = time (0)) == -1)
|
||||||
scm_syserror (s_time_plus_ticks);
|
scm_syserror (s_gettimeofday);
|
||||||
SCM_ALLOW_INTS;
|
SCM_ALLOW_INTS;
|
||||||
return scm_cons (scm_long2num (timv), SCM_MAKINUM (0));
|
return scm_cons (scm_long2num (timv), SCM_MAKINUM (0));
|
||||||
# endif
|
# endif
|
||||||
|
@ -405,18 +405,6 @@ scm_init_stime()
|
||||||
if (!scm_your_base) time(&scm_your_base);
|
if (!scm_your_base) time(&scm_your_base);
|
||||||
#endif
|
#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();
|
if (!scm_my_base) scm_my_base = mytime();
|
||||||
|
|
||||||
scm_add_feature ("current-time");
|
scm_add_feature ("current-time");
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
extern SCM scm_get_internal_real_time SCM_P ((void));
|
extern SCM scm_get_internal_real_time SCM_P ((void));
|
||||||
extern SCM scm_get_internal_run_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_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_localtime (SCM time, SCM zone);
|
||||||
extern SCM scm_gmtime (SCM time);
|
extern SCM scm_gmtime (SCM time);
|
||||||
extern SCM scm_mktime (SCM sbd_time);
|
extern SCM scm_mktime (SCM sbd_time);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue