summaryrefslogtreecommitdiff
blob: 17741ae352c25226378c0d6c211a18042a1b55b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
fix compilation on Darwin

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24862#23
https://bugs.gentoo.org/show_bug.cgi?id=612338

--- guile-2.0.14/libguile/filesys.c
+++ guile-2.0.14/libguile/filesys.c
@@ -1486,6 +1486,9 @@
       mode_bits = scm_i_mode_bits (mode);
     }
 
+#ifdef __APPLE__
+  open_flags &= O_APPEND|O_SHLOCK|O_EXLOCK|O_CLOEXEC;
+#endif
   SCM_SYSCALL (rv = mkostemp (c_tmpl, open_flags));
   if (rv == -1)
     SCM_SYSERROR;
--- guile-2.0.14/libguile/stime.c
+++ guile-2.0.14/libguile/stime.c
@@ -830,6 +830,10 @@
 
 #ifdef HAVE_POSIX_CPUTIME
   {
+#ifdef __APPLE__
+    if (clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &posix_run_time_base) == 0)
+      get_internal_run_time = get_internal_run_time_posix_timer;
+#else
     clockid_t dummy;
     
     /* Only use the _POSIX_CPUTIME clock if it's going to work across
@@ -839,6 +843,7 @@
       get_internal_run_time = get_internal_run_time_posix_timer;
     else
       errno = 0;
+#endif
   }
 #endif /* HAVE_POSIX_CPUTIME */
 #endif /* HAVE_CLOCKTIME */