50 |
#ifdef __MINGW32__ |
#ifdef __MINGW32__ |
51 |
#include <sys/timeb.h> |
#include <sys/timeb.h> |
52 |
int usleep ( unsigned int microseconds ); |
int usleep ( unsigned int microseconds ); |
53 |
|
void Lget_system_time_zone(void); |
54 |
#endif |
#endif |
55 |
|
|
56 |
#ifdef BSD |
#ifdef BSD |
151 |
() |
() |
152 |
{ |
{ |
153 |
#ifdef __MINGW32__ |
#ifdef __MINGW32__ |
154 |
static struct timeb t0; |
static struct timeb t0; |
155 |
struct timeb t; |
struct timeb t; |
156 |
if (t0.time == 0) ftime(&t0); |
if (t0.time == 0) ftime(&t0); |
157 |
ftime(&t); |
ftime(&t); |
158 |
return make_fixnum((t.time - t0.time)*HZ1 + ((t.millitm)*HZ1)/1000); |
return make_fixnum((t.time - t0.time)*HZ1 + ((t.millitm)*HZ1)/1000); |
175 |
#endif |
#endif |
176 |
} |
} |
177 |
|
|
178 |
|
#ifdef __MINGW32__ |
179 |
|
DEFVAR("*DEFAULT-TIME-ZONE*",sSAdefault_time_zoneA,SI,make_fixnum ( system_time_zone_helper() ),""); |
180 |
|
#else |
181 |
DEFVAR("*DEFAULT-TIME-ZONE*",sSAdefault_time_zoneA,SI,make_fixnum(TIME_ZONE),""); |
DEFVAR("*DEFAULT-TIME-ZONE*",sSAdefault_time_zoneA,SI,make_fixnum(TIME_ZONE),""); |
182 |
|
#endif |
183 |
|
|
184 |
void |
void |
185 |
init_unixtime(void) |
init_unixtime(void) |
195 |
|
|
196 |
make_function("SLEEP", Lsleep); |
make_function("SLEEP", Lsleep); |
197 |
make_function("GET-INTERNAL-RUN-TIME", Lget_internal_run_time); |
make_function("GET-INTERNAL-RUN-TIME", Lget_internal_run_time); |
198 |
|
#ifdef __MINGW32__ |
199 |
|
make_function("GET-SYSTEM-TIME-ZONE", Lget_system_time_zone); |
200 |
|
#endif |
201 |
} |
} |
202 |
|
|
203 |
#ifdef __MINGW32__ |
#ifdef __MINGW32__ |
207 |
unsigned int milliseconds = microseconds / 1000; |
unsigned int milliseconds = microseconds / 1000; |
208 |
return ( SleepEx ( milliseconds, TRUE ) ); |
return ( SleepEx ( milliseconds, TRUE ) ); |
209 |
} |
} |
210 |
|
|
211 |
|
int system_time_zone_helper(void) |
212 |
|
{ |
213 |
|
TIME_ZONE_INFORMATION tzi; |
214 |
|
DWORD TZResult; |
215 |
|
int tz=0; |
216 |
|
check_arg(0); |
217 |
|
TZResult = GetTimeZoneInformation ( &tzi ); |
218 |
|
|
219 |
|
/* Now UTC = (local time + bias), in units of minutes, so */ |
220 |
|
/*fprintf ( stderr, "Bias = %ld\n", tzi.Bias );*/ |
221 |
|
tz = (int) (tzi.Bias / 60); |
222 |
|
return ( tz ); |
223 |
|
} |
224 |
|
|
225 |
|
void |
226 |
|
Lget_system_time_zone(void) |
227 |
|
{ |
228 |
|
vs_push ( make_fixnum ( system_time_zone_helper() ) ); |
229 |
|
} |
230 |
|
|
231 |
#endif |
#endif |