summaryrefslogtreecommitdiff
path: root/coro.h
diff options
context:
space:
mode:
Diffstat (limited to 'coro.h')
-rw-r--r--coro.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/coro.h b/coro.h
index 8f7a796..6a2b632 100644
--- a/coro.h
+++ b/coro.h
@@ -38,7 +38,7 @@
/*
* 2006-10-26 Include stddef.h on OS X to work around one of its bugs.
* Reported by Michael_G_Schwern.
- * 2006-11-25 Use _setjmp instead of setjmp on GNU/Linux.
+ * 2006-11-26 Use _setjmp instead of setjmp on GNU/Linux.
*/
#ifndef CORO_H
@@ -171,7 +171,11 @@ struct coro_context {
jmp_buf env;
};
-#define coro_transfer(p,n) do { if (!setjmp ((p)->env)) longjmp ((n)->env, 1); } while(0)
+#if CORO_LINUX
+# define coro_transfer(p,n) do { if (!_setjmp ((p)->env)) _longjmp ((n)->env, 1); } while(0)
+#else
+# define coro_transfer(p,n) do { if (!setjmp ((p)->env)) longjmp ((n)->env, 1); } while(0)
+#endif
#endif