… | |
… | |
36 | */ |
36 | */ |
37 | |
37 | |
38 | /* |
38 | /* |
39 | * 2006-10-26 Include stddef.h on OS X to work around one of its bugs. |
39 | * 2006-10-26 Include stddef.h on OS X to work around one of its bugs. |
40 | * Reported by Michael_G_Schwern. |
40 | * Reported by Michael_G_Schwern. |
|
|
41 | * 2006-11-26 Use _setjmp instead of setjmp on GNU/Linux. |
41 | */ |
42 | */ |
42 | |
43 | |
43 | #ifndef CORO_H |
44 | #ifndef CORO_H |
44 | #define CORO_H |
45 | #define CORO_H |
45 | |
46 | |
… | |
… | |
168 | |
169 | |
169 | struct coro_context { |
170 | struct coro_context { |
170 | jmp_buf env; |
171 | jmp_buf env; |
171 | }; |
172 | }; |
172 | |
173 | |
|
|
174 | #if CORO_LINUX |
173 | #define coro_transfer(p,n) do { if (!setjmp ((p)->env)) longjmp ((n)->env, 1); } while(0) |
175 | # define coro_transfer(p,n) do { if (!_setjmp ((p)->env)) _longjmp ((n)->env, 1); } while(0) |
|
|
176 | #else |
|
|
177 | # define coro_transfer(p,n) do { if (!setjmp ((p)->env)) longjmp ((n)->env, 1); } while(0) |
|
|
178 | #endif |
174 | |
179 | |
175 | #endif |
180 | #endif |
176 | |
181 | |
177 | #endif |
182 | #endif |
178 | |
183 | |