/[guile]/guile/guile-core/libguile/stime.c
ViewVC logotype

Diff of /guile/guile-core/libguile/stime.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.75 by xxhanwen, Sat Jul 20 14:08:34 2002 UTC revision 1.76 by mdj, Thu Jan 23 16:04:37 2003 UTC
# Line 1  Line 1 
1  /* Copyright (C) 1995,1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.  /* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2003 Free Software Foundation, Inc.
2   *   *
3   * This program is free software; you can redistribute it and/or modify   * This program is free software; you can redistribute it and/or modify
4   * it under the terms of the GNU General Public License as published by   * it under the terms of the GNU General Public License as published by
# Line 66  Line 66 
66  #include <string.h>  #include <string.h>
67  #endif  #endif
68    
 # ifdef TIME_WITH_SYS_TIME  
 #  include <sys/time.h>  
 #  include <time.h>  
 # else  
 #  ifdef HAVE_SYS_TIME_H  
 #   include <sys/time.h>  
 #  else  
 #   ifdef HAVE_TIME_H  
 #    include <time.h>  
 #   endif  
 #  endif  
 # endif  
   
69  #ifdef HAVE_SYS_TIMES_H  #ifdef HAVE_SYS_TIMES_H
70  # include <sys/times.h>  # include <sys/times.h>
71  #endif  #endif
# Line 98  extern char *tzname[]; /* RS6000 and oth Line 85  extern char *tzname[]; /* RS6000 and oth
85  extern char *strptime ();  extern char *strptime ();
86  #endif  #endif
87    
 /* This should be figured out by autoconf.  */  
 #if ! defined(CLKTCK) && defined(CLK_TCK)  
 #  define CLKTCK ((int) CLK_TCK)  
 #endif  
 #if ! defined(CLKTCK) && defined(CLOCKS_PER_SEC)  
 #  define CLKTCK ((int) CLOCKS_PER_SEC)  
 #endif  
 #if ! defined(CLKTCK)  
 #  define CLKTCK 60  
 #endif  
   
88  #ifdef __STDC__  #ifdef __STDC__
89  # define timet time_t  # define timet time_t
90  #else  #else
# Line 125  timet mytime() Line 101  timet mytime()
101  }  }
102  #else  #else
103  # ifdef LACK_CLOCK  # ifdef LACK_CLOCK
104  #    define mytime() ((time((timet*)0) - scm_your_base) * CLKTCK)  #    define mytime() ((time((timet*)0) - scm_your_base) * SCM_TIME_UNITS_PER_SECOND)
105  # else  # else
106  #  define mytime clock  #  define mytime clock
107  # endif  # endif
# Line 153  SCM_DEFINE (scm_get_internal_real_time, Line 129  SCM_DEFINE (scm_get_internal_real_time,
129    tmp = scm_sum (tmp,    tmp = scm_sum (tmp,
130                   scm_product (SCM_MAKINUM (1000),                   scm_product (SCM_MAKINUM (1000),
131                                SCM_MAKINUM (time_buffer.time)));                                SCM_MAKINUM (time_buffer.time)));
132    return scm_quotient (scm_product (tmp, SCM_MAKINUM (CLKTCK)),    return scm_quotient (scm_product (tmp, SCM_MAKINUM (SCM_TIME_UNITS_PER_SECOND)),
133                         SCM_MAKINUM (1000));                         SCM_MAKINUM (1000));
134  #else  #else
135    return scm_long2num((time((timet*)0) - scm_your_base) * (int)CLKTCK);    return scm_long2num((time((timet*)0) - scm_your_base) * (int)SCM_TIME_UNITS_PER_SECOND);
136  #endif /* HAVE_FTIME */  #endif /* HAVE_FTIME */
137  }  }
138  #undef FUNC_NAME  #undef FUNC_NAME
# Line 706  void Line 682  void
682  scm_init_stime()  scm_init_stime()
683  {  {
684    scm_c_define ("internal-time-units-per-second",    scm_c_define ("internal-time-units-per-second",
685                  scm_long2num((long)CLKTCK));                  scm_long2num((long) SCM_TIME_UNITS_PER_SECOND));
686    
687  #ifdef HAVE_FTIME  #ifdef HAVE_FTIME
688    if (!scm_your_base.time) ftime(&scm_your_base);    if (!scm_your_base.time) ftime(&scm_your_base);

Legend:
Removed from v.1.75  
changed lines
  Added in v.1.76

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26