From: Shenghou Ma Date: Mon, 24 Feb 2014 01:37:43 +0000 (-0500) Subject: misc/cgo/testso: don't use TLS variables on Darwin and OpenBSD. X-Git-Tag: go1.3beta1~624 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bcf3d55ed99b7b7e689e05a8333ba89d337c0cad;p=gostls13.git misc/cgo/testso: don't use TLS variables on Darwin and OpenBSD. Fix build for 10.6 Darwin builders and OpenBSD builers. LGTM=jsing R=golang-codereviews, dave, jsing CC=golang-codereviews https://golang.org/cl/67710043 --- diff --git a/misc/cgo/testso/cgoso_c.c b/misc/cgo/testso/cgoso_c.c index 9b77a76fcf..7a38022b54 100644 --- a/misc/cgo/testso/cgoso_c.c +++ b/misc/cgo/testso/cgoso_c.c @@ -17,6 +17,10 @@ __declspec(dllexport) void sofunc(void); #else extern void goCallback(void); void setCallback(void *f) { (void)f; } +#endif + +// OpenBSD and older Darwin lack TLS support +#if !defined(__OpenBSD__) && !defined(__APPLE__) __thread int tlsvar = 12345; #endif diff --git a/misc/cgo/testso/cgoso_unix.go b/misc/cgo/testso/cgoso_unix.go index e86f992642..7d5444cd12 100644 --- a/misc/cgo/testso/cgoso_unix.go +++ b/misc/cgo/testso/cgoso_unix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd +// +build dragonfly freebsd linux netbsd package cgosotest