UnixOperatingSystem.st
changeset 10800 1a11961ddab2
parent 10791 6af9a9da7262
child 10930 95015f0d599e
--- a/UnixOperatingSystem.st	Wed Nov 21 18:24:05 2007 +0100
+++ b/UnixOperatingSystem.st	Thu Nov 22 14:11:35 2007 +0100
@@ -105,6 +105,7 @@
 # ifndef WANT_SYSTEM
 #  define WANT_SYSTEM
 # endif
+
 # define WANT_SHM
 # define HAS_SETENV
 # define HAS_UNSETENV
@@ -248,7 +249,6 @@
 
 
 # ifdef aix
-
 #  ifndef _TIME_H_INCLUDED_
 #   include <time.h>
 #   define _TIME_H_INCLUDED_
@@ -257,9 +257,28 @@
 #   include <sys/select.h>
 #   define _SYS_SELECT_H_INCLUDED_
 #  endif
-
 # endif /* aix */
 
+# ifdef __osx__
+#  include <time.h>
+
+struct tm {
+	int	tm_sec;		/* seconds after the minute [0-60] */
+	int	tm_min;		/* minutes after the hour [0-59] */
+	int	tm_hour;	/* hours since midnight [0-23] */
+	int	tm_mday;	/* day of the month [1-31] */
+	int	tm_mon;		/* months since January [0-11] */
+	int	tm_year;	/* years since 1900 */
+	int	tm_wday;	/* days since Sunday [0-6] */
+	int	tm_yday;	/* days since January 1 [0-365] */
+	int	tm_isdst;	/* Daylight Savings Time flag */
+	long	tm_gmtoff;	/* offset from CUT in seconds */
+	char	*tm_zone;	/* timezone abbreviation */
+};
+
+
+# endif
+
 # ifndef _STDIO_H_INCLUDED_
 #  include <stdio.h>
 #  define _STDIO_H_INCLUDED_
@@ -8304,7 +8323,7 @@
     |seconds micros error|
 
 %{
-#if defined(_POSIX_MONOTONIC_CLOCK) && !defined(NO_CLOCK_GETTIME)
+#if defined(_POSIX_MONOTONIC_CLOCK) && defined(CLOCK_MONOTONIC) && !defined(NO_CLOCK_GETTIME)
     struct timespec ts;
     static int has_clock_gettime = 1;
 
@@ -8372,7 +8391,7 @@
 
     long t = 0;
 
-#if defined(_POSIX_MONOTONIC_CLOCK) && !defined(NO_CLOCK_GETTIME)
+#if defined(_POSIX_MONOTONIC_CLOCK) && defined(CLOCK_MONOTONIC) && !defined(NO_CLOCK_GETTIME)
     static has_clock_gettime = 1;
     struct timespec ts;
 
@@ -12538,7 +12557,7 @@
 !UnixOperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.243 2007-11-19 11:59:56 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.244 2007-11-22 13:11:35 cg Exp $'
 ! !
 
 UnixOperatingSystem initialize!