Conversation
Weirdly if _XOPEN_SOURCE is not defined near the top of the file, then the entire ucontext fallback fails. I think this define is affecting various includes on apple, so it's defined near the very tip top of everything
|
Weirdly if _XOPEN_SOURCE is not defined near the top of the file, then the entire ucontext fallback fails. I think this define is affecting various includes on apple, so it's defined near the very tip top of everything |
|
I found three nice links with a ton of info on this topic.
Search for the keyword |
| "movq %r13, %rdi\n\t" | ||
| #if defined(__APPLE__) | ||
| "sub $8, %rsp\n\t" | ||
| #endif |
There was a problem hiding this comment.
Offsetting here will probably make the dummy return address endup in the wrong place. The dummy return address assists debugging as the last function in the backtrace when you put a breakpoint inside a coroutine. The offset should be really on _mco_makectx to overcome this, just like other platform ifdefs offsets there.
| #define MINICORO_IMPL | ||
| #include "minicoro.h" | ||
| #define C89THREAD_IMPLEMENTATION | ||
| #include "thirdparty/c89thread.h" |
There was a problem hiding this comment.
Actually I am trying to support the c89thread (from David Reid the author of miniaudio) so I don't wish to change the library here, I told him the issue there about the Mac OS compilation and he fixed, and the library has been updated in a recent commit.
Thanks for helping out, researching this and getting minicoro running on Mac OS! From what we have read we need to offset then by 8 bytes and we should be fine on Mac. |
|
Thanks @RandyGaul I went ahead and made the changes on my side in a8f3698 |
Getting things to work on Apple, at least a little bit