--- a/Unix.st Mon Jul 28 20:47:21 1997 +0200
+++ b/Unix.st Mon Jul 28 20:56:30 1997 +0200
@@ -459,6 +459,22 @@
#define _HANDLEVal(o) (HANDLE)(__MKCP(o))
#endif
+/*
+ * not all systems have time_t and off_t
+ * explicit add of those we know to have ...
+ */
+#ifdef __osf__
+# define TIME_T time_t
+# define OFF_T off_t
+#endif
+
+#ifndef TIME_T
+# define TIME_T long
+#endif
+#ifndef OFF_T
+# define OFF_T long
+#endif
+
%}
! !
@@ -7351,11 +7367,13 @@
osSeconds := osTime // 1000.
%{
struct tm* tmPtr;
- long t;
+ INT t;
+ TIME_T tt;
t = __longIntVal(osSeconds);
-
- tmPtr = localtime(&t);
+ tt = (TIME_T)t;
+
+ tmPtr = localtime(&tt);
year = __MKSMALLINT(tmPtr->tm_year + 1900);
month = __MKSMALLINT(tmPtr->tm_mon + 1);
day = __MKSMALLINT(tmPtr->tm_mday);
@@ -7378,7 +7396,7 @@
%{
struct tm tm;
- long t;
+ TIME_T t;
if (__bothSmallInteger(y, m)
&& __bothSmallInteger(d, h)
@@ -7393,7 +7411,7 @@
tm.tm_isdst = -1;
t = mktime(&tm);
- osSeconds = __MKUINT(t);
+ osSeconds = __MKUINT((INT)t);
}
%}.
osSeconds notNil ifTrue:[
@@ -7422,7 +7440,8 @@
%{
struct tm *tmPtr;
struct tm *gmTmPtr;
- long t;
+ INT t;
+ TIME_T tt;
#if defined(HAS_NO_TIMEZONE)
# define TIMEZONE tmPtr->tm_gmtoff
@@ -7435,8 +7454,9 @@
#endif
t = __longIntVal(osSeconds);
-
- tmPtr = localtime(&t);
+ tt = (TIME_T)t;
+
+ tmPtr = localtime(&tt);
hours = __MKSMALLINT(tmPtr->tm_hour);
minutes = __MKSMALLINT(tmPtr->tm_min);
seconds = __MKSMALLINT(tmPtr->tm_sec);
@@ -7491,11 +7511,13 @@
millis := osTime \\ 1000.
%{
struct tm *tmPtr;
- long t;
+ INT t;
+ TIME_T tt;
t = __longIntVal(osSeconds);
-
- tmPtr = localtime(&t);
+ tt = (TIME_T)t;
+
+ tmPtr = localtime(&tt);
hours = __MKSMALLINT(tmPtr->tm_hour);
minutes = __MKSMALLINT(tmPtr->tm_min);
seconds = __MKSMALLINT(tmPtr->tm_sec);
@@ -8991,6 +9013,6 @@
!OperatingSystem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.236 1997-07-28 18:35:18 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.237 1997-07-28 18:56:30 cg Exp $'
! !
OperatingSystem initialize!