summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2018-08-30 04:53:16 -0700
committerAndreas Rumpf <rumpf_a@web.de>2018-08-30 13:53:16 +0200
commit3e6b58323bb1c33bfa6d1a70905ee10e4f20f638 (patch)
treec52241b6512c715addcbd81a7ffe2959bf7185ed /lib
parented0cb7b85d8d48bcebb63a5e90a45a4e29bcb673 (diff)
downloadNim-3e6b58323bb1c33bfa6d1a70905ee10e4f20f638.tar.gz
fix tests/coroutines/texceptions.nim (#8810)
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/coro.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/pure/coro.nim b/lib/pure/coro.nim
index 6d7dcf078..2fe34ed40 100644
--- a/lib/pure/coro.nim
+++ b/lib/pure/coro.nim
@@ -115,7 +115,12 @@ elif coroBackend == CORO_BACKEND_SETJMP:
 when defined(unix):
   # GLibc fails with "*** longjmp causes uninitialized stack frame ***" because
   # our custom stacks are not initialized to a magic value.
-  {.passC: "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0"}
+  when defined(osx):
+    # workaround: error: The deprecated ucontext routines require _XOPEN_SOURCE to be defined
+    const extra = " -D_XOPEN_SOURCE"
+  else:
+    const extra = ""
+  {.passC: "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" & extra.}
 
 const
   CORO_CREATED = 0