aboutsummaryrefslogtreecommitdiffstats
path: root/coroutine
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-12-27 15:01:01 -0800
committerJeremy Evans <code@jeremyevans.net>2019-12-27 15:01:01 -0800
commitf05416c91f4656db652ad9e63c5aa049dd5c0936 (patch)
tree3b5de5ab72e6d94a434df2794bf0d01a72c09865 /coroutine
parentc74d30e7950f18fd9fadcfa404790e8fb0e891fd (diff)
downloadruby-f05416c91f4656db652ad9e63c5aa049dd5c0936.tar.gz
Fix coroutine copy implementation on OpenBSD
OpenBSD is the only platform that uses this support by default, and it did not work because while OpenBSD supports alloca, it does not include alloca.h. This should be backported to Ruby 2.7. From George Koehler
Diffstat (limited to 'coroutine')
-rw-r--r--coroutine/copy/Context.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/coroutine/copy/Context.h b/coroutine/copy/Context.h
index 1319f55d16..5e5d9e037a 100644
--- a/coroutine/copy/Context.h
+++ b/coroutine/copy/Context.h
@@ -12,7 +12,11 @@
#include <setjmp.h>
#include <string.h>
#include <stdlib.h>
+
+/* OpenBSD supports alloca, but does not include alloca.h */
+#ifndef __OpenBSD__
#include <alloca.h>
+#endif
#define COROUTINE __attribute__((noreturn)) void