Skip to content

Commit ea6ca7e

Browse files
authored
Merge pull request #92 from janciesko/mac-allow-system-ucontext-2
Mac allow system ucontext
2 parents 6cefff6 + 2a368b4 commit ea6ca7e

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

config/qthread_check_swapcontext.m4

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,7 @@ AS_IF([test "x$ac_cv_func_getcontext" = "xyes"], [
6363
[the uc_stack structure in ucontext_t has an ss_flags structure that needs to be initialized])])
6464
AC_CACHE_CHECK([whether swapcontext works properly],
6565
[qthread_cv_swapcontext_works],
66-
[
67-
case "$host" in
68-
*-darwin*)
69-
qthread_cv_swapcontext_works=no
70-
;;
71-
*)
72-
AC_RUN_IFELSE([AC_LANG_SOURCE([[
66+
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
7367
#include <ucontext.h>
7468
#include <stdlib.h>
7569
ucontext_t child, parent;
@@ -97,9 +91,7 @@ int main()
9791
[AS_IF([test "x$enable_fastcontext" = xyes],
9892
[qthread_cv_swapcontext_works=no],
9993
[qthread_cv_swapcontext_works=yes])],
100-
[qthread_cv_swapcontext_works=yes])])
101-
;;
102-
esac])
94+
[qthread_cv_swapcontext_works=yes])])])
10395
AS_IF([test "$qthread_cv_swapcontext_works" = yes],
10496
[AC_DEFINE([HAVE_NATIVE_MAKECONTEXT], [1], [The system provides functional native make/swap/get-context functions])
10597
QTHREAD_CHECK_MAKECONTEXT_SPLIT_ARGS(

src/fastcontext/asm.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# define SET _qt_setmctxt
4444
# define GET _qt_getmctxt
4545
# else
46-
# error What kind of a Mac is this?
46+
# error What kind of a Mac is this? If M1, use CFLAGS=-D_XOPEN_SOURCE and --disable-fastcontext --with-default-stack-size=65536 in configure.
4747
# endif
4848
#elif defined(__linux__)
4949
# if (QTHREAD_ASSEMBLY_ARCH == QTHREAD_ARM)

0 commit comments

Comments
 (0)