47 |
#undef BSD |
#undef BSD |
48 |
#define ATT |
#define ATT |
49 |
#endif |
#endif |
50 |
|
#if defined __MINGW32__ || defined __GNUC__ |
51 |
#ifdef __MINGW32__ |
#ifdef __MINGW32__ |
52 |
#include <sys/timeb.h> |
#include <sys/timeb.h> |
53 |
int usleep ( unsigned int microseconds ); |
int usleep ( unsigned int microseconds ); |
|
void Lget_system_time_zone(void); |
|
54 |
#endif |
#endif |
55 |
|
void Lget_system_time_zone(void); |
56 |
|
#endif /* __MINGW32__ and __GNUC__ */ |
57 |
|
|
58 |
#ifdef BSD |
#ifdef BSD |
59 |
#include <time.h> |
#include <time.h> |
177 |
#endif |
#endif |
178 |
} |
} |
179 |
|
|
180 |
#ifdef __MINGW32__ |
#if defined __MINGW32__ || defined __GNUC__ |
181 |
DEFVAR("*DEFAULT-TIME-ZONE*",sSAdefault_time_zoneA,SI,make_fixnum ( system_time_zone_helper() ),""); |
DEFVAR("*DEFAULT-TIME-ZONE*",sSAdefault_time_zoneA,SI,make_fixnum ( system_time_zone_helper() ),""); |
182 |
#else |
#else |
183 |
DEFVAR("*DEFAULT-TIME-ZONE*",sSAdefault_time_zoneA,SI,make_fixnum(TIME_ZONE),""); |
DEFVAR("*DEFAULT-TIME-ZONE*",sSAdefault_time_zoneA,SI,make_fixnum(TIME_ZONE),""); |
197 |
|
|
198 |
make_function("SLEEP", Lsleep); |
make_function("SLEEP", Lsleep); |
199 |
make_function("GET-INTERNAL-RUN-TIME", Lget_internal_run_time); |
make_function("GET-INTERNAL-RUN-TIME", Lget_internal_run_time); |
200 |
#ifdef __MINGW32__ |
#if defined __MINGW32__ || defined __GNUC__ |
201 |
make_function("GET-SYSTEM-TIME-ZONE", Lget_system_time_zone); |
make_function("GET-SYSTEM-TIME-ZONE", Lget_system_time_zone); |
202 |
#endif |
#endif |
203 |
} |
} |
215 |
TIME_ZONE_INFORMATION tzi; |
TIME_ZONE_INFORMATION tzi; |
216 |
DWORD TZResult; |
DWORD TZResult; |
217 |
int tz=0; |
int tz=0; |
218 |
check_arg(0); |
|
219 |
TZResult = GetTimeZoneInformation ( &tzi ); |
TZResult = GetTimeZoneInformation ( &tzi ); |
220 |
|
|
221 |
/* Now UTC = (local time + bias), in units of minutes, so */ |
/* Now UTC = (local time + bias), in units of minutes, so */ |
223 |
tz = (int) (tzi.Bias / 60); |
tz = (int) (tzi.Bias / 60); |
224 |
return ( tz ); |
return ( tz ); |
225 |
} |
} |
226 |
|
#endif |
227 |
|
|
228 |
|
#ifdef __GNUC__ |
229 |
|
int system_time_zone_helper(void){ |
230 |
|
|
231 |
|
struct tm *local; |
232 |
|
time_t TIME; |
233 |
|
int nsecs; |
234 |
|
|
235 |
|
TIME = time(0); |
236 |
|
local = localtime(&TIME); |
237 |
|
nsecs = local->tm_gmtoff; |
238 |
|
if (nsecs == 0) |
239 |
|
return (nsecs); |
240 |
|
else |
241 |
|
return(- (nsecs / 60 / 60)); |
242 |
|
} |
243 |
|
#endif /*__GNUC__*/ |
244 |
|
|
245 |
|
#if defined __MINGW32__ || defined __GNUC__ |
246 |
void |
void |
247 |
Lget_system_time_zone(void) |
Lget_system_time_zone(void) |
248 |
{ |
{ |
249 |
vs_push ( make_fixnum ( system_time_zone_helper() ) ); |
check_arg(0); |
250 |
|
vs_push ( make_fixnum ( system_time_zone_helper() ) ); |
251 |
} |
} |
252 |
|
|
253 |
#endif |
#endif /*__MINGW32__ and __GNUC__ */ |