Fix make-array transforms.
[sbcl.git] / src / runtime / darwin-os.h
1 #ifndef _DARWIN_OS_H
2 #define _DARWIN_OS_H
3
4 /* this is meant to be included from bsd-os.h */
5
6 #include <mach/mach_init.h>
7 #include <mach/task.h>
8 #include <AvailabilityMacros.h>
9 #include <sys/cdefs.h>
10
11 /* man pages claim that the third argument is a sigcontext struct,
12    but ucontext_t is defined, matches sigcontext where sensible,
13    offers better access to mcontext, and is of course the SUSv2-
14    mandated type of the third argument, so we use that instead.
15    If Apple is going to break ucontext_t out of spite, I'm going
16    to be cross with them ;) -- PRM */
17
18 #if defined(LISP_FEATURE_X86)
19 #include <sys/ucontext.h>
20 #include <sys/_types.h>
21
22 #if __DARWIN_UNIX03
23 typedef struct __darwin_ucontext os_context_t;
24 #else
25 typedef struct ucontext os_context_t;
26 #endif
27
28
29 #else
30 typedef ucontext_t os_context_t;
31 #endif
32
33 #define SIG_MEMORY_FAULT SIGBUS
34
35 #define SIG_STOP_FOR_GC (SIGUSR2)
36
37 #ifdef LISP_FEATURE_MACH_EXCEPTION_HANDLER
38 extern mach_port_t current_mach_task;
39 #endif
40
41 void darwin_init(void);
42
43 #ifdef LISP_FEATURE_SB_THREAD
44 #define CANNOT_USE_POSIX_SEM_T
45 #include <mach/semaphore.h>
46 typedef semaphore_t os_sem_t;
47 #endif
48
49 #endif /* _DARWIN_OS_H */