]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: set _XOPEN_SOURCE_EXTENDED for netbsd
authorMichael Pratt <mpratt@google.com>
Tue, 12 Sep 2023 17:35:15 +0000 (13:35 -0400)
committerMichael Pratt <mpratt@google.com>
Tue, 12 Sep 2023 18:26:38 +0000 (18:26 +0000)
If _XOPEN_SOURCE is defined, then netbsd also requires
_XOPEN_SOURCE_EXTENDED to define stack_t.

For #62440.

Change-Id: Ib05658c3ca7fae1f6b051566e713ce7bc7c037a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/527775
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/runtime/testdata/testprogcgo/stackswitch.c

index 36258c1e183cc96f680a6084cf28470fab68fa2e..2395cda56807264538c51b67f7eac9da1672b720 100644 (file)
@@ -6,6 +6,8 @@
 
 // Required for darwin ucontext.
 #define _XOPEN_SOURCE
+// Required for netbsd stack_t if _XOPEN_SOURCE is set.
+#define _XOPEN_SOURCE_EXTENDED
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
 #include <assert.h>