cloudwu / coroutine

A asymmetric coroutine library for C.
MIT License
2.44k stars 686 forks source link

./main在MacOSX无法正常运行,可能与sys/ucontext.h已经被osX系统废止有关。 #7

Closed Yuandong-Chen closed 7 years ago

Yuandong-Chen commented 7 years ago

在osX下,程序在coroutine.c 150行,运行到assert(0)退出。在linux下正常运行。

CoderDuMeng commented 7 years ago

define _XOPEN_SOURCE

if APPLE && MACH

include

else

include <sys/ucontext.h>

endif

在mac上 加上这个才能编译 运行成功 作者头文件导入错误

Yuandong-Chen commented 7 years ago

我说的是运行时错误,不是编译时错误。。。

CoderDuMeng commented 7 years ago

对 你这样就能运行了

CoderDuMeng commented 7 years ago

我上面不是说了 编程 和 运行成功

Yuandong-Chen commented 7 years ago

是可以运行,我这么说吧,无论导入sys/ucontext.h还是导入ucontext.h,还是都导入,即使编译通过,在我的macosX上可以运行,但是会运行到assert(0),这也算是运行成功的,但是这是程序本身有问题。(sys/ucontext.h组件已经不再被支持了,也就是说这个程序是几年前可以运行成功的,现在不一定了)

CoderDuMeng commented 7 years ago

我就运行成功 你为什么不可以