summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct11
1 files changed, 9 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct
index 4c67d73f..9584c317 100644
--- a/SConstruct
+++ b/SConstruct
@@ -762,13 +762,20 @@ extern "C" {
typedef int clockid_t;
#define CLOCKID_T_DEFINED
# endif
-/* OS X uses _STRUCT_TIMESPEC, but no clock_gettime */
-#ifndef _STRUCT_TIMESPEC
+/*
+ * OS X 10.5 and later use _STRUCT_TIMESPEC (like other OSes)
+ * 10.4 uses _TIMESPEC
+ * 10.3 and earlier use _TIMESPEC_DECLARED
+ */
+#if !defined(_STRUCT_TIMESPEC) \
+ && !defined(_TIMESPEC) && !defined(_TIMESPEC_DECLARED)
+#define _STRUCT_TIMESPEC
struct timespec {
time_t tv_sec;
long tv_nsec;
};
#endif
+/* OS X does not have clock_gettime */
#define CLOCK_REALTIME 0
int clock_gettime(clockid_t, struct timespec *);
# ifdef __cplusplus