libthread: use our own swapcontext/makecontext even on OS X 10.5
This commit is contained in:
parent
88cf592723
commit
2640996af8
2 changed files with 11 additions and 5 deletions
|
|
@ -20,11 +20,8 @@ case "$tag" in
|
||||||
*-NetBSD-*)
|
*-NetBSD-*)
|
||||||
echo ${SYSNAME}-${OBJTYPE}-asm.o $SYSNAME.o
|
echo ${SYSNAME}-${OBJTYPE}-asm.o $SYSNAME.o
|
||||||
;;
|
;;
|
||||||
*-Darwin-[6-8].*)
|
|
||||||
echo ${SYSNAME}-${OBJTYPE}-asm.o ${SYSNAME}-${OBJTYPE}.o pthread.o
|
|
||||||
;;
|
|
||||||
*-Darwin-*)
|
*-Darwin-*)
|
||||||
echo pthread.o
|
echo ${SYSNAME}-${OBJTYPE}-asm.o ${SYSNAME}-${OBJTYPE}.o pthread.o
|
||||||
;;
|
;;
|
||||||
*-OpenBSD-*)
|
*-OpenBSD-*)
|
||||||
echo ${SYSNAME}-${OBJTYPE}-asm.o ${SYSNAME}-${OBJTYPE}.o $SYSNAME.o
|
echo ${SYSNAME}-${OBJTYPE}-asm.o ${SYSNAME}-${OBJTYPE}.o $SYSNAME.o
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,20 @@ extern int swapcontext(ucontext_t*, ucontext_t*);
|
||||||
extern void makecontext(ucontext_t*, void(*)(), int, ...);
|
extern void makecontext(ucontext_t*, void(*)(), int, ...);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
|
#if defined(__APPLE__)
|
||||||
|
/*
|
||||||
|
* OS X before 10.5 (Leopard) does not provide
|
||||||
|
* swapcontext nor makecontext, so we have to use our own.
|
||||||
|
* In theory, Leopard does provide them, but when we use
|
||||||
|
* them, they seg fault. Maybe we're using them wrong.
|
||||||
|
* So just use our own versions, even on Leopard.
|
||||||
|
*/
|
||||||
# define mcontext libthread_mcontext
|
# define mcontext libthread_mcontext
|
||||||
# define mcontext_t libthread_mcontext_t
|
# define mcontext_t libthread_mcontext_t
|
||||||
# define ucontext libthread_ucontext
|
# define ucontext libthread_ucontext
|
||||||
# define ucontext_t libthread_ucontext_t
|
# define ucontext_t libthread_ucontext_t
|
||||||
|
# define swapcontext libthread_swapcontext
|
||||||
|
# define makecontext libthread_makecontext
|
||||||
# if defined(__i386__)
|
# if defined(__i386__)
|
||||||
# include "386-ucontext.h"
|
# include "386-ucontext.h"
|
||||||
# else
|
# else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue